0 votes
1.8k 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

+1 vote
1 answer 814 views
0 votes
1 answer 1.1k views
asked Jun 13, 2016 in Magento by Jelena
+1 vote
0 answers 1.3k views
0 votes
2 answers 5.9k views
asked Jul 17, 2018 in General by anonymous
0 votes
3 answers 2.5k views
asked Jan 31, 2017 in Laravel by anonymous
...