Last word using JavaScript

by aburayane

HTML

<textarea name="recepients"  onkeyup="myFunction()"></textarea>

JavaScript

function myFunction(){

var ind, nb,
    oElements = document.getElementsByName('recepients');
for (ind = 0, nb = oElements.length; ind < nb; ind += 1) {
  console.log(oElements[ind].value);
}
}