Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Basic Note Pad</title>
- <script>
- function format(cmd)
- {
- document.execCommand(cmd, false);
- }
- </script>
- </head
- <body>
- <div id="controls">
- <button onclick="format('bold')">Bold</button>
- <button onclick="format('italic')">Italic</button>
- <button onclick="format('underline')">Underline</button>
- <button onclick="format('indent')">Indent</button>
- <button onclick="format('outdent')">Unindent</button>
- <button onclick="format('undo')">Undo</button>
- <button onclick="format('redo')">Redo</button>
- </div>
- <h1 id="docTitle" contentEditable="true">My Document</h1>
- <hr>
- <div id="myDoc" contentEditable="true" spellcheck="true">
- Create your doc here!
- </div>
- </body>
- </html>
- <!--More complete example at
- https://developer.mozilla.org/en-US/docs/Rich-Text_Editing_in_Mozilla#Executing_Commands
- -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement