Words For each space make ul
have a new class
Then put the word inside li
By clicking on the button
<!DOCTYPE html>
<head>
</head>
<body>
<textarea id ="myArea"class="rebaz"rows=4 cols=50>hello my name is rebaz</textarea>
<button onclick="show();">Show content</button>
<script>
let contextMenu = document.getElementsByClassName("word id")[0];
</script>
</body>
<script src="./main.js" type="text/javascript"></script>
<script src="cheack.js"></script>
</html>
after click button Crete dynamically this ul and li
<ul class="word1">
<li>hello</li>
</ul>
<ul class="word2">
<li>my</li>
</ul>
<ul class="word3">
<li>name</li>
</ul>
<ul class="word4">
<li>is</li>
</ul>
<ul class="word5">
<li>rebaz</li>
</ul>
3
Answers
Try it this way