0 votes
13 views
asked in Jquery by
How can we strip the HTML from a string (extract only text content) in Javascript. I do not need the texts inside the inner html tags as well.

1 Answer

0 votes
answered by
If thats a <div> element. Please do the below.

alert($(this).find('div').html().replace(/<[^>]+>/g,''));

Related questions

0 votes
1 answer 19 views
asked Jun 12, 2016 in Magento by Jelena
+1 vote
0 answers 557 views
0 votes
2 answers 97 views
0 votes
3 answers 584 views
asked Jan 30, 2017 in Laravel by anonymous
+1 vote
1 answer 5k views
asked May 10, 2017 in Jquery by Jasna
...