I have a section of code which I don't have full control over which includes a Div with no class or id. I'd like to remove the opening and closing tag of this Div and keep the existing content, but not sure how to target this and remove ?
currently...
<li id="foo" class="underline">
<div>
<input id="username" name="username" required="required" class="validate" type="text">
</div>
<label for="username">Username</label>
</li>
the final result i would like...
<li id="foo" class="underline">
<div class="mynewdiv">
<input id="bar" name="bar" required="required" class="validate" type="text">
<label for="bar">Username</label>
</div>
</li>
I have control to add teh newDiv. My question has similarities to how can I remove wrapper (parent) without removing the child but i'm not sure how to properly target this unnamed div (with closest?). Thanks