Consider this my value:
var value = "<br><br><div class="test">-- Thanks, <br><div><br></div></div>";
I want to remove test class div tag i.e <div class="test1">
and related to closing tag </div>
.
Expecting results will be:
"<br><br>-- Thanks, <br><div><br></div>"
I am trying with regular expression:
value = value.replace(/(<div class="test">|<\/div>)/g, '');
but it's removing adjacent div tag:
<br><br><div class="test">-- Thanks, <br><div><br>
not the exactly with the closing tag.
How to do this?