Remove HTML Tags | JavaScriptSource

Remove HTML Tags

Robert Nyman Feb 5, 2007

General

This function will remove all HTML tags from a string.


Input code: (Note: Processing is done on the "input-code" id)
<h2>About</h2>
<p>Here you will find posts about news, trends and
developing for Internet, mainly focusing on browsers
and Web user interfaces.</p>
<p><a href="/about">Read more</a></p>
» Click to remove all HTML tags from the input code.

Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: removeHTMLTags.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(5 comments)

Thanks man!! you saved my time and made things run fast!!

kalpesh Aug 7, 2008

I'm not sure what you mean.

Lee Jun 26, 2008

There is a difference in IE and Firefox. In IE the tags are stripped and in FF the whole text box is stripped.[br /][br /]Is there anyway to change this? I really appreciate the script by the way. Thanks.

Ian Feb 1, 2008

You might want to re-check your script. It works fine for me in FF 2.0.0.9

Lee Nov 6, 2007

hi[br /]your function is not working in firefox.[br /][br /]pls reformat your script.[br /][br /]dipan

dipan Sep 22, 2007