Advertisement
metalx1000

Very Basic Note Pad Document Editor - Word Processor

Jul 5th, 2013
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.04 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>Basic Note Pad</title>
  4.     <script>
  5.         function format(cmd)
  6.         {
  7.                 document.execCommand(cmd, false);
  8.         }
  9.      </script>
  10. </head
  11. <body>
  12.         <div id="controls">
  13.                 <button onclick="format('bold')">Bold</button>
  14.                 <button onclick="format('italic')">Italic</button>
  15.                 <button onclick="format('underline')">Underline</button>
  16.                 <button onclick="format('indent')">Indent</button>
  17.                 <button onclick="format('outdent')">Unindent</button>
  18.                 <button onclick="format('undo')">Undo</button>
  19.                 <button onclick="format('redo')">Redo</button>
  20.         </div>
  21.         <h1 id="docTitle" contentEditable="true">My Document</h1>
  22.         <hr>
  23.  
  24.         <div id="myDoc" contentEditable="true" spellcheck="true">
  25.         Create your doc here!
  26.         </div>
  27. </body>
  28. </html>
  29.  
  30. <!--More complete example at
  31. https://developer.mozilla.org/en-US/docs/Rich-Text_Editing_in_Mozilla#Executing_Commands
  32. -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement