I have some elements like
<div id="one">ONE</div>
<div id="two">TWO</div>
<div id="three">THREE</div>
<div id="four">FOUR</div>
<div id="five">FIVE</div>
Now I want to wrap a DIV tag around the two elements with the ID "two" and "three" to get this:
<div id="one">ONE</div>
<div class="wrapped">
<div id="two">TWO</div>
<div id="three">THREE</div>
</div>
<div id="four">FOUR</div>
<div id="five">FIVE</div>
With the "wrapAll" function i can only target elements with the same class I think like:
$(document).ready(function(){
$( "div" ).wrapAll( "<div class='wrapped' />");
});
I know I could give the two DIVs the same class with jquery first and then wrap them but I hope there is a more elegant way.