HTML
  Home arrow HTML arrow Page 3 - Building a WYSIWYG HTML Editor Part 1/2
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Building a WYSIWYG HTML Editor Part 1/2
By: Mitchell Harper
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 329
    2002-02-27

    Table of Contents:
  • Building a WYSIWYG HTML Editor Part 1/2
  • Why a WYSIWYG editor
  • execCommand examples
  • Building our HTML editor
  • Building our HTML editor (contd.)
  • Building our HTML editor (contd.)
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building a WYSIWYG HTML Editor Part 1/2 - execCommand examples


    (Page 3 of 7 )

    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):
    • ForeColor: Get or set the foreground color of the selected region.
    • BackColor: Get or set the background color of the selected region.
    • Bold: Toggles between the select region being bolded.
    • Italic: Toggles between the selected region being italicised.
    • Underline: Toggles between the select region being underlined.
    • Copy: Copies the selected region to the clipboard.
    • Cut: Removes the selected region from the document.
    • Paste: Adds data from clipboard to region (if applicable).
    • InsertHorizontalRule: Adds a horizontal rule to the region.
    • InsertImage: Displays an IE defined modal dialog that contains full image selection features, alt tag modification, border setting, etc.
    • InsertMarquee: Converts the selected text into a marque.
    • InsertSelectDropDown: Adds a drop down list to the region.
    • Print: Displays the windows print dialog so that the region can be printed.
    • Refresh: Refreshes the region.
    • CreateLink: Displays an IE defined modal dialog that lets you add a hyperlink using either selected text or new text.
    • InsertUnorderedList: Toggles between the selected text being an unordered list and normal text.
    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.

    More HTML Articles
    More By Mitchell Harper


       · Good to see that there is a breakdown of what sometimes seems to be masses of code...
     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT