Skip to content

Commit 849572c

Browse files
Remove all HTML tags from a string (#1539)
* Remove all html tags.js Will remove all the html tags * readme.md
1 parent 4cb3952 commit 849572c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var html = '<div id="someid"><span>Hello World</span></div>'; // insert your html content
2+
var outputString = html.replace(/<\/?[^>]+(>|$)/g, ""); // output will a string without the HTML tags
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Will accept a html and remove all the html tags and give a string from it.

0 commit comments

Comments
 (0)