The problem that I face is that I could achieve what I need but showing it in the console, but my goal is that as it appears in the console, each word is assigned a span, there is some code in jquery that makes it possible , thank you very much in advance.
This is the challenge I want to achieve ... link ... it's about pasting a text and then when I click on a word this gives me several options between it translate it, I want to do something similar to what the video shows, I do not know if it is possible to do it with Jquery or I need another programming language, I am stuck in that part, Thank you.
$("#span").click(function() {
alert("es posible meter cada palabra en <span>?");
var textArea = $('#words');
var arrayOfWords = textArea.val().split(" ");
$.each(arrayOfWords, function(i, word){
console.log(word) // es en esta parte donde no se que codigo usar para meter cada palabra en <span> despues de darle click
})
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="button" name="" value="meter cada palabra que pegue en el Textarea en <span>" id="span"> <br><br>
<textarea id="words" autocomplete="off" spellcheck="false" autocapitalize="off" autocorrect="off" ></textarea>