I have a span in the form of:
<span eid="4" etype="dc" class="remove-absolute" style="display: block">
<div>
<span>ttttttt</span>
<p>ttttttt</p>
</div>
</span>
I want to change the outerHTML(from span to div), so it looks like:
<**div** eid="4" etype="dc" class="remove-absolute" style="display: block">
<div>
<span>ttttttt</span>
<p>ttttttt</p>
</div>
</**div**>
I checked other solutions, I tried replaceWith, but it doesn't work.
I tried:
$('[etype="dc"]')[0].replaceWith("abcd");
$('[etype="dc"]')[0].outerHTML => is still unchanged. canI get some help?
Thanks!