I have a requirement to change the parent Div's text color based on it's one of the child div's text, I have implemented following method to get the parent Div element using xpath(please note that I'm still on the way to change the style, Just abled to access the immediate Div object ). the code is working fine in chrome and EDGE .but it doesn't work for IE11. Can some one help me to implement a different approach for this which will work for all three browsers.
---------------- HTML structure-----------------------
<div class="table" id="finalResults" >
<div class="table_row" >
<div class="cell_wrapper">
<div class="cell" >City</div> <div class="cell" >Destination city not found</div>
</div>
</div>
</div
```
```
---------------- javascript code-----------------------
var xpath = "//div[starts-with(text(), 'Destination city not found')]";
var matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
document.getElementById("demo").innerHTML = matchingElement.innerHTML;
})
```