Is it possible to wrap each word individually in a tag? On the example of the text: Cras ultricies ligula sed magna dictum porta
just would have each word be individually in the tag
var container = document.querySelector(".symbols"); var str = container.innerHTML; for(var i = 0; i < str.length; i++) { var e = document.createElement("span"); e.innerHTML = str[i]; container.appendChild(e); }
<div class="symbols">lorem ipsum sit ammet dolar </div>
So I tried - it turns out to wrap only the sentence