0 votes
112 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 21 views
asked Jun 12, 2016 in Magento by Jelena
+1 vote
0 answers 579 views
0 votes
2 answers 2.3k views
0 votes
3 answers 664 views
asked Jan 30, 2017 in Laravel by anonymous
+1 vote
1 answer 8k views
asked May 10, 2017 in Jquery by Jasna
...