How to insert <div> within a <td> using JQuery and place all the child elements of <td> within the <div>?
Lets say I have the HTML rendered in the below mentioned format.
<td class="known_td">
<input ../>
<img ../>
</td>
The updated HTML should look like,
<td class="known_td">
<div>
<input ../>
<img ../>
</div>
</td>
$('.known_td').wrapInner('<div />');
Update:
It's worth noting that you can treat the tag passed to wrapInner() as a normal html element declaration, adding classes, ID, etc:
$('.known_td').wrapInner('<div id="neo" class="dynamic" />');
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With