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) {
use regexp:
if ( divs[i].textContent.match ( /\bword\b/ ) ){ //do something }
@RobG remind me so
if ( divs[i].innerHTML.match ( /\bword\b/ ) ){ //do something }
=3=