Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'

JavaScript
// check if divId contains the word 'word' in innertext 

if (document.getElementById('divId').innerHTML.indexOf("word") != -1) { 
 // do something
}// check if divId contains the word 'word' in innertext 

if (document.getElementById('divId').innerHTML.indexOf("word") != -1) { 
 // do something
}
Source

Also in JavaScript: