I want to remove an HTML tag from a string, e.g. remove div, p, br, ...
I am trying to do this:
var mystring = "<div><p>this</p><p>is</p><p>my</p><p>text</p><p>sample</p><p> </p><p> </p></div>" var html3 = $(mystring).text();
but the result:
"thisismytextsample "
How to do it: "this is my sample text"
source share