0 votes
1.5k 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 534 views
0 votes
1 answer 780 views
asked Jun 13, 2016 in Magento by Jelena
+1 vote
0 answers 1.1k views
0 votes
2 answers 5.6k views
asked Jul 17, 2018 in General by anonymous
0 votes
3 answers 2.1k views
asked Jan 31, 2017 in Laravel by anonymous
...