<HTML>
<HEAD>
<TITLE> Regular Expressions: stripping HTML tags </TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
var htstring = '<p align="Left"><b>Hello</b> <I>World</I></p>';
var stripped = htstring.replace(/(<([^>]+)>)/ig,"");
with (document) {
write ('Original string:' + htstring + '<br>');
write ('Stripped string:<br><br>' + stripped);
}
</SCRIPT>
</BODY>
</HTML>
Tuesday, August 26, 2008
Subscribe to:
Post Comments (Atom)
1 comment:
Hi Shanmugarajan,
Your post was really helpfull for me.
Thanks a lot...
Post a Comment