How can I check if a div contains a certain word?
var divs= document.getElementsByTagName(\'div\'); for (var i = 0, len = divs.length; i < len; ++i) {
You have to use a comparison operator not assign a variable.
if (divs[i].text == '*word*'){
I would recommend to use indexOf.
indexOf
if (divs[i].text.indexOf('*word*') != -1){