Agrupar con un tag un elemento después de una imagen con jQuery
Cuando no tenemos acceso al html y necesitamos añadir un tag al texto que hay después de una imagen.
Tenemos:
<header>
<h1>Portfolio</h1>
</header>
Y necesitamos
<div>
<img src="" />
<span>Lorem ipsum dolor sit amet.</span>
</div>
jQuery snippet
$(document).ready(function() {
$('div').contents().filter(function () {
return this.nodeType === 3 && $.trim(this.nodeValue).length;
}).wrap('<span />');
});