Given textarea is a textarea element with id \'textareabox\', how can I check if it contains a string within it?
var textarea = document.getElementById(\'tex
You could do something like this:
var textarea = document.getElementById('textareabox').value; if (texarea.match(word) != null) { // do some stuff }
A better regex than what I did but I don't know regex all that well (forgive me regex ignorance).