Based on he content of text i need to change the color ,for eg:- for PASS green color and for FAIL red color. This contents are in a table in td tag. I have tried to write a js ,but not able to achieve the result.
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
if (document.getElementById("changeColour").innerHTML == "PASS") {
document.getElementById("changeColour").style.color = "#FE2E2E";
}
else if (document.getElementById("changeColour").innerHTML == "FAIL") {
document.getElementById("changeColour").style.backgroundColor = "blue";
</script>
</head>
And my HTML body is is :-
table>
<caption><h4>SUMMARY</h4></caption>
<tr>
<tr>
<td><h6>Operation1</h6></td>
<td id="changeColor">PASS</td>
</tr>
<tr>
<td><h6>Operation2</h6></td>
<td><h6 id="changeColor">FAIL</h6></td>
</tr>
</table>