193
rated 0 times
[
199]
[
6]
/ answers: 1 / hits: 20105
/ 10 Years ago, wed, august 6, 2014, 12:00:00
Given textarea is a textarea element with id 'textareabox', how can I check if it contains a string within it?
var textarea = document.getElementById('textareabox');
var word = something;
if (!textarea.contains(word))
{
textarea.value += word;
}
More From » javascript