JSFiddle - React, Tailwind, and code Playground

by jim ulle

HTML

<p>hello there jim, how are you doing today?</p>

JavaScript

var text = $.trim($('p').text()),
    word = text.split(' '),
    str = "";
//alert(word[1]);
$.each( word, function( key, value ) {
  //alert( key + ": " + value );
  if(key != 0) { str += " "; }
  str += "<span>" + value + "</span>";
});
$('p').html(str);