JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<div id="greeting">
<h1>here is a test text. <strong>We believe this is better</strong> than ever.</h1>
</div>
CSS
strong {
font-weight: bold;
}
JavaScript
var h1 = $('div#greeting h1');
h1.hide().contents().each(function() {
var words;
if (this.nodeType === 3) {
words = '<span> ' + this.data.split(/\s+/).join(' </span><span> ') + ' </span>';
$(this).replaceWith(words);
} else if (this.nodeType === 1) {
this.innerHTML = '<span> ' + this.innerHTML.split(/\s+/).join(' </span><span> ') + ' </span>';
}
});
h1.find('span').hide().each(function() {
if( !$.trim(this.innerHTML) ) {
$(this).remove();
}
});
h1.show().find('span').each(function(i) {
$(this).delay(400 * i).fadeIn(600);
});