Wrap each word in Span jQuery

// wrap each word in page titles in span for formatting
var title_words = $('h1.entry-title, h1.is-style-entry-title').text().split(" ");
$('h1.entry-title, h1.is-style-entry-title').empty();
var zindex = 50;
$.each(title_words, function(i, v) {
     zindex--;
     $('h1.entry-title, h1.is-style-entry-title').append($('<span style="z-index: ' + zindex + ';">').text(v));
});