JSFiddle - React, Tailwind, and code Playground

by jrl2000

HTML

<div id="transcriptText"> It's that time of year when you clean out your
        closets, dust off shelves, and spruce up your floors. Once you've taken
        care of the dust and dirt, what about some digital cleaning? Going
        through all your files and computers may seem like a daunting task, but
        we found ways to make the process fairly painless.</div>
        <div id='test'>
        
        </div>

JavaScript

var content = document.getElementById('transcriptText');
var test = document.getElementById('test');
content.setAttribute('class','test')
var txt = content.innerText;
var words = txt.split(" ");
for (i = 0; i < words.length; i++){
	var x = document.createElement('span');
  var t = document.createTextNode(words[i]);
  x.appendChild(t);
  test.appendChild(x);
  
  console.log(words[i])
};



words.forEach(function(i){
	newList = '<span>' + words[i] + '</span>';
  console.log(newList);
 	
  });