converting html into plaintext
-
hi friends i need to know how to convert html contents into plain text. these html contents are from the ajax editor. any help would be of great benefit to me. K.Gayathri
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
hi friends i need to know how to convert html contents into plain text. these html contents are from the ajax editor. any help would be of great benefit to me. K.Gayathri
Here is a sample code to accept the value(HTML) from a text field and gives the Plain text out of it: function Check(){ var pattern = new RegExp("<(.|\\n)*?>","g"); //alert(pattern); alert(document.formName.fieldName.value.replace(pattern,"")); } The HTML Portion :
String :
Text field can be replaced by reading the HTML content from .html file also. INPUT: My html page Hello world OUTPUT : My html page Hello world HTH
Sovan