html contents into plain text
-
hi i am having the following function in javascript: function passvalue() { var editor = $find("<%=Editor1.ClientID%>"); var content = editor.get_content(); window.opener.document.getElementById("ctl00_cphMain_txtEditor").value = content; self.close(); } in this function in am getting the editor contents but all are in html format. can anyone plz tell me how to convert the contents into plain text. K.Gayathri
-
hi i am having the following function in javascript: function passvalue() { var editor = $find("<%=Editor1.ClientID%>"); var content = editor.get_content(); window.opener.document.getElementById("ctl00_cphMain_txtEditor").value = content; self.close(); } in this function in am getting the editor contents but all are in html format. can anyone plz tell me how to convert the contents into plain text. K.Gayathri
var nonHTMLcontent = document.getElementById(ControlIdContainsHTMLContent).contentWindow.document.execCommand("RemoveFormat",false,null)
Here
ControlIdContainsHTMLContent
contains HTML content. In
nonHTMLcontent
variable you will get content after removing formatting. Hope this will help.
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."
-
var nonHTMLcontent = document.getElementById(ControlIdContainsHTMLContent).contentWindow.document.execCommand("RemoveFormat",false,null)
Here
ControlIdContainsHTMLContent
contains HTML content. In
nonHTMLcontent
variable you will get content after removing formatting. Hope this will help.
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."