L'ho testato su jsfiddle ma cosiì e sembra funzionare.
Come posso fare però la stessa cosa con il mio esempio all'inizio?<div class="prova">
<h1>Lorem ipsum: dolor sit amet<br></h1>
<h1> Et ideo autem: ipsum dolor sit amet<br></h1>
</div>
$(function() {
$('h1').each(function() {
var words = $(this).text().split(':');
$(this).empty().html(function() {
for (i = 0; i < words.length; i++) {
$(this).append(' <span>' + words[i] + '</span>');
}
});
});
});
![]()