Tutorials » Building a WYSIWYG HTML Editor Using Only JavaScript and HTML

execCommand examples

Now that we're a little bit more familiar with the execCommand method, let's look at a list of some of the commands that we can perform with it (the complete list is available here):

As you can see, we can do some pretty powerful things with the execCommand method. Let's build an advanced HTML content editor that allows us to toggle between HTML mode and WYSIWYG mode, format text, add images, links, lists and more.

 
  1 2 3 4 5 6 7