A simple text editor, you learn the first editor program, share, you can learn.
<HTML> <HEAD> <TITLE>ubb</TITLE> </HEAD> <BODY> <font face= " "> <table width=" cellspacing= "0" cellpadding= "1" border= "0" bgcolor= "ButtonFace" > & lt;tr> <td height= "20px" width= "18px" onclick= ' doaction ("Bold") ' onmousedown= ' Dodown (e_bold); "OnMouseOver = "On_mouseover (e_bold);" Onmouseout= "On_mouseout (e_bold);" > </td> <td height= "20px" width= "18px" onclick= ' doaction ("italic") ' onmousedown= ' Dodown (e_italic); " Onmouseover= "On_mouseover (e_italic);" Onmouseout= "On_mouseout (e_italic);" > </td> <td width= "264px" > </td> </tr> <tr> <TD colspan= "3" > <iframe id= "Editor" name= "Editor" border= "0" scroll= "no" width= "" height= "" &G " t;</iframe> </td> </tr> </table> <script language= "JavascRipt ">//initialize the IFRAME function window.onload () {Editor.document.designMode =" on "; Editor.document.open (); Editor.document.write (""); Editor.document.close (); Editor.focus (); function On_mouseover (thistd) {thisTD.style.borderLeft = "1px solid buttonhighlight"; ThisTD.style.borderRight = "1px solid Buttonshadow"; ThisTD.style.borderTop = "1px solid buttonhighlight"; ThisTD.style.borderBottom = "1px solid Buttonshadow"; function On_mouseout (thistd) {thisTD.style.borderLeft = ""; ThisTD.style.borderRight = ""; ThisTD.style.borderTop = ""; ThisTD.style.borderBottom = ""; function Dodown (THISTD) {thistd.style. borderleft = "1px solid Buttonshadow"; Thistd.style. borderright = "1px solid buttonhighlight"; Thistd.style. bordertop = "1px solid Buttonshadow"; Thistd.style. BorderBottom = "1px solid buttonhighlight"; Thistd.style. paddingtop = "2px"; Thistd.stYle. paddingleft = "2px"; Thistd.style. paddingbottom = "0px"; Thistd.style. paddingright = "0px"; function Doaction (str) {var m_objtextrange = Editor.document.selection.createRange (); M_objtextrange.execcommand (str); } </script> </BODY> </HTML>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]