Remove HTML Tags
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>
Notes
- Created by: Robert Nyman
- Web Site: http://robertnyman.com/
- Posted: February 5, 2007
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!!
I'm not sure what you mean.
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.
You might want to re-check your script. It works fine for me in FF 2.0.0.9
hi[br /]your function is not working in firefox.[br /][br /]pls reformat your script.[br /][br /]dipan