This javascript function will help you to remove/strip HTML tags typed in text area or in text box.
Features
You can remove the html tags typed in a textarea/textbox.
This javascript displays strips any character or tags given inside the tag.
Just copy the code in to your page and use it.
Simple and ease of use.
Preview
Downloads
Javascript Code
<!-- Script by hscripts.com --> <script type="text/javascript"> function stripHTML() { var re = /(<([^>]+)>)/gi; for (i=0; i < arguments.length; i++) arguments[i].value=arguments[i].value.replace(re, "") } </script> <!-- Script by hscripts.com -->
HTML Code
<!-- Script by hscripts.com --> <form name="myform"> <textarea style="background-color:f0f0f0; border 1px border:1px solid #afc784;" name=remove rows=4 cols=40></textarea><br> <input type="button" value="Remove HTML Tags" onClick="stripHTML(this.form.remove)"> </form> <!-- Script by hscripts.com -->
For customization of this script or any script development, mail to support@hscripts.com
Usage
Here we have explained how to use the strip html tag javascript with the help of a form. When you click remove HTML tags button, it will remove the html tags entered into textbox.
Copy the javascript code into the part of your HTML page.
Copy the HTML code, to create a textarea into the <body> tag.