I am trying to use jQuery to find <td>s with given content (text) inside. For example:
http://sotkra.com/btol/index.php
From left to right, the 7th COLUMN that reads ‘TIPO MONEDA’ displays either PESOS or DOLARES. I’d like to be able to do the following:
-
Select
<td>s with the text ‘DOLARES’ or ‘PESOS’ and add a class to them. -
Select
<td>s with the text ‘DOLARES’ or ‘PESOS’ and add a class to their parent<tr>s.
For #1, I tried with this:
$('td[innerHTML=Dolares]').addClass('highlight');
and also
$('td[html=Dolares]').addClass('highlight');
Neither of which worked.
You want to use
:contains.for the parent