This will show you how to change the text label inside a div on the page based on another string on the page.
First it’s getting all Div elements and then looking into the innerHTML for the word “open”.
If its found change the background to red – this is used to help figure out which element you are targetting.
Then will change the label to ‘Cleanliness’
var divs= document.getElementsByTagName('div'); for (var i = 0, len = divs.length; i < len; ++i) { if(divs[i].innerHTML.indexOf("Open") !== -1) { document.write("
");
document.querySelector("#p_c13c4ee5b_9652_4e30_aac5_a1597e9a8bae tbody tr:nth-child(1) td:nth-child(5) label").innerHTML =' Cleanliness';
} }