Javascript rich text editor: removeFormat and show plain HTML by execCommand

LinNnDi

New Member
I am trying to make simplest javascript rich text editor and this is working fine with some simple formats in HTML.Things not working-1. Remove format from editor-What i tried-\[code\]var richTextEditor=document.getElementById("RTE"); $('#remove').live('click',function(){ richTextEditor.contentDocument.designMode = 'ON'; richTextEditor.contentDocument.body.contentEditable=true; richTextEditor.contentDocument.execCommand('removeFormat',false,null); richTextEditor.focus(); });\[/code\]And-2. Show plain HTML within \[code\]iframe\[/code\]What i tried-\[code\]$('#plain').live('click',function(){ richTextEditor.contentDocument.designMode = 'ON'; richTextEditor.contentDocument.body.contentEditable=true; richTextEditor.contentDocument.execCommand('innerHTML',false,'<body>'); richTextEditor.focus();});\[/code\]Guide me through live edit-Rich text editor
 
Back
Top