I’m trying to remove the strong element from this HTML using jQuery but cant make it work (note: message_id here is actually PHP code, but I removed it for readability):
<p class="comments-layout" id="strong_messageid"><strong>text</strong></p>
I’ve tried his:
$('#strong'+messageid).children().first().unwrap();
after rearranging but did not work.
Assuming that you want the
<p>element, you have to select the children elements and then unwrap it to remove just the#strongXelement.