I have some HTML as a string
var str= "<p><br/></p>"
How do I strip the p tags from this string using JS. here is what I have tried so far:
str.replace(/<p[^>]*>(?:\s| )*<\/p>/, "") // o/p: <p><br></p>'
str.replace("/<p[^>]*><\\/p[^>]*>/", "")// o/p: <p><br></p>'
str.replace(/<p><br><\/p>/g, "")// o/p: <p><br></p>'
all of them return me same str as above, expected o/p is:
str should be ""
what im doing wrong here?
Thanks
tag – user1234 Oct 13 '21 at 19:10
? – roneicostajr Oct 13 '21 at 19:11
– user1234 Oct 13 '21 at 19:12<\/p>/g", "");`- didnt work
tag. It has a
– Wyck Oct 13 '21 at 19:14tag in it. ??