js update div if it contains string code example
Example: Javascript - check if div contains a word? - Stack Overflow
if (document.getElementById('divId').innerHTML.indexOf("word") != -1) { }
if (document.getElementById('divId').innerHTML.indexOf("word") != -1) { }