JSFiddle - React, Tailwind, and code Playground

HTML

<div id="h">

</div>
<div id="words">

</div>

CSS

#words div.MyClass {
    border: solid 1px;
    margin: 10px 0;
}

JavaScript

var a = "Hello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you bodyHello world my name is Mohammed and i love JavaScript and this is just random text to test in it I hope you are having a good time Love you body";

var h = document.getElementById("h");
var words = document.getElementById("words");
var arr_a = a.match(/[\t\s\n\r]*[^\t\s\n\r]+/g) || [];
h.innerHTML="The length of words in the string is " + arr_a.length;
var text, div;
var count = 50;
for (var i = 0; i...