0 votes
642 views
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
by
If thats a <div> element. Please do the below.

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

Related questions

0 votes
1 answer 91 views
asked Jun 13, 2016 in Magento by Jelena
+1 vote
0 answers 641 views
0 votes
2 answers 4.2k views
asked Jul 17, 2018 in General by anonymous
0 votes
3 answers 807 views
asked Jan 31, 2017 in Laravel by anonymous
+1 vote
1 answer 9.2k views
asked May 11, 2017 in Jquery by Jasna
...