Remove HTML Tags | JavaScriptSource

Remove HTML Tags

Robert Nyman Feb 5, 2007


This function will remove all HTML tags from a string.

Input code: (Note: Processing is done on the "input-code" id)
<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.


Source Code

Paste this source code into the designated areas.

External file

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


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


Paste this code into the BODY section of your HTML document

Leave a Response


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

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