I have this code:
var textarea = document.getElementById('myTextarea');
var tag = '<!DOCTYPE html>';
var textValue = textarea.value;
if (textValue.indexOf(tag) != -1) {
document.getElementById('status').innerHTML = "match found";
} else {
document.getElementById('status').innerHTML = "no match found";
}
I’m trying to get indexOf
to match tag no matter if the var
tag is in upper-case or lower-case. How can I go about doing this?