I have the following structure of row in my table:
<tr class="mattersRow">
<td></td>
<td colspan="16">
<div class="dropdown">
<a href="#" data-toggle="dropdown">Choose QB</a>
<ul class="dropdown-menu" aria-labelledby="dLabel" role="menu"> … </ul>
</div>
</td>
</tr>
Note: I use bootstrap library
I need to set to every <td> that has text inside "" (empty), or "Choose QB" class='danger'.
This is my jQuery code:
$("#tblMatters .mattersRow td").each(function () {
if ($(this).html() == "" || $(this).innerHTML == "Choose QB")
{
$(this).addClass("danger");
flag = true;
}
});
Of course, $(this).html() == "" works great, but how to set "danger" class to the <td> with Choose QB