Reputation: 1411
I'm trying to wrap my table with a new tr and then all the td's inside the wrapping tr.
My code is as follows:
$('.ccbnBgTblTxt td').wrap('<tr class="new"/>');
What I'm trying to do is.. this
<tr class="new"><td></td><td></td><td></td></tr>
Right now I'm getting results like this.
<tr class="new"><td></td></tr><tr class="new"><td></td></tr>
Anyway to wrap all the td's?
Upvotes: 1
Views: 863
Reputation: 104775
Try using the .wrapAll()
function
$('.ccbnBgTblTxt td').wrapAll('<tr class="new"/>');
Upvotes: 3