0
Expensive;
I have an html page that contains three Mysql database information (
HIGH, Medium and Low). I wanted only the word
HIGH was in red, Medium in orange and Low in blue. I tried to do via PHP with Swicth Case, but without success. Since I don’t know anything about Jquery, I wanted to have an idea and help from you. I searched a lot on the Internet, but without success. Example of the HTML part:
<td><font size='1'><div id=add9 align=middle style='color: XXX ' > HIGH<td>
I don’t know if there is any Pluguin in Jquery, which scans the div, locates the text and through the text it changes the color of the same.
Example of my table :
$row['subject']."</td><td>"."<font size='1'>"."<div id='div_result' align='middle'>".
$row['score']."</div>"."<td><a href=delete.php?id=".
Html snippet:
<table class="table table-bordred table-striped" >
<thead>
<th><input type="checkbox" id="idALL" name="nameALL" onClick="CheckAll()" /></th>
<th>Qtde</th>
<th>Data</th>
<th>IP</th>
<th>Hostname</th>
<th>Sender</th>
<th>Subject</th>
<th>Score</th>
Grateful to anyone who can help.
With jQuery:
if ($("#add9").html() == "HIGH") { $("#add9").css("color", "red") }
. But remember, if there’s more than onediv
with the text "HIGH", useclass
instead ofid
in jQuery.– Douglas Garrido
The information comes through a While, so the same div (add9) is used for both Hight, Medium and Low), thus working only on Ifs'?
– user54154