Forum Moderators: open

Message Too Old, No Replies

How to create a w3schools style WYSIWYG?

Wysiwyg

         

abhishekkaushik

1:27 pm on Jun 7, 2007 (gmt 0)

10+ Year Member



I want to create online WYSIWYG that will simulate the HTML codes very same as w3schools.com. I am using two iframe tags to partition the windows document area. In one halve the user will write HTML tags. The other will take the code from this and set the source code of other halve equal to this. Can somebody suggest how this can be done. Thanks in advance.

geofflee

12:09 pm on Jun 17, 2007 (gmt 0)

10+ Year Member



You need two things: a <textbox> and a <div>.

Grab the value of the <textbox> and use the <div>'s "innerHTML" property to inject HTML.

-Geoffrey Lee

abhishekkaushik

1:06 pm on Jun 17, 2007 (gmt 0)

10+ Year Member



Thanks geofflee

information is valuable to me.

abhishekkaushik

2:25 pm on Jun 17, 2007 (gmt 0)

10+ Year Member



one small doubt,how to enable the scroll into the div block when the width of element are getting out of hand. Do we have to use <textarea> tag instead of <div>. i have seen many online Javascrpt WYSIWYG/ Rich Text editors that use the <textarea> with some JS class.