как всегда в ИЕ работает, в ФФ ошибка - uncaught exception
| Код | <html> <head> <title>HTML Area</title> </head> <style> .btn { width:25px; height:25px; } #EditFrame { width:500; height:150; border:solid 1px #000000; } </style> <body> <table> <tr> <td> <input type=button class=btn onClick="EditField.execCommand('bold', false, null)" value=b> <input type=button class=btn onClick="EditField.execCommand('underline', null, null)" value=u> <input type=button class=btn onClick="EditField.execCommand('italic',null,null)" value=i> <input type=button class=btn onClick="EditField.body.innerHTML+='<table border=1><tr><td>ff</td></tr></table>'"> </td> </tr> <tr> <td> <iframe id="EditFrame" style="" frameborder="0" contenteditable="true"></iframe> </td> </tr> </table> <script language=javaScript> if (navigator.userAgent.match(/msie/i)) EditField = frames['EditFrame'].document; else if (navigator.userAgent.match(/gecko/i)) EditField = document.getElementById('EditFrame').contentDocument; else alert("Editor is not supported by your browser"); EditField.designMode = 'On'; </script> </body> </html>
| |