Is it possible to wrap all three <span> in one <div> ?
<span class='wrap'>Span 1</span>
<span class='wrap'>Span 2</span>
<span class='wrap'>Span 3</span>
Here is a wrapper <div id="parentWrapper"></div>
Upon my running code below each span has an individual <div> and alerts three times its context
$(document).ready(function(){
$('span.wrap').wrap('<div id="parentWrapper">');
$('div#parentWrapper').each(function(){
alert($(this).html());
});
});
There is a
wrapAll()methodReference wrapAll() docs