I need to wrap text inside a div with a span.
<div class="item">
<span class="count"></span>
Text that needs to be wrapped.
</div>
<div class="item">
<span class="count"></span>
Text that needs to be wrapped.
</div>
<div class="item">
<span class="count"></span>
Text that needs to be wrapped.
</div>
Tried this but it did not really work…
$('.item').text().wrap('<span class="new" />');
You can do it using contents() and .eq()
http://jsfiddle.net/qUUbW/