JavaScript remove html tags from string
![]() |
| javascript remove html tags from string |
In this Lesson we are Going to learn how to remove html tags from string.
just follow the below example to learn how to convert html to plain text..
index.html
<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>
<div align="center">
<h2>JavaScript Covert HTML to Plain text</h2>
<form name="myform">
<textarea style="background-color:f0f0f0; border 1px border:1px solid #afc784;" name="remove" rows="15" cols="40"></textarea><br>
<input type="button" value="Remove HTML Tags" onClick="stripHTML(this.form.remove)">
</form>
</div>
=>Result:
![]() |
| javascript remove html tags from string |
That's it Guys how to remove html tag from string and covert it plain text..
Keep Visiting This blog for more codes ..Thank You..



No comments:
Post a Comment
Thank You for Your Comment
Note: Only a member of this blog may post a comment.