I think the best solution for a textarea
input is using the match()
function of javascript like this:
var words = []
$('textarea').on('blur', function(){
words = $(this).val().match(/\w+/g)
alert(words)
})
here a fiddle of it working.
This doesn't need for the words to be in different lines.