wrapAll two siblings - How?
Hello,
I want to wrap two html elements with a <div>.
I want only the <img> that has a next sibling '<div class="last">'
and
'<div class="last">' that has the previous sibling <img>
First I tried with no avail
$('.main img ~ div.last').wrapAll('<div></div>');
I've tried adding
$('.main img ~ div.last').prev().next().wrapAll('<div></div>');
But that just wraps the next sibling, not including the previous.
Could someone point me in the right direction?