Question: 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:

1. Select `<td>`s with the text 'DOLARES' or 'PESOS' and add a class to them.
2. 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.

Answer: 
You want to use [`:contains`](http://docs.jquery.com/Selectors/contains#text).

```
$('td:contains("Dolares")').addClass('highlight');

```

for the parent

```
$('td:contains("Dolares")').parent().addClass('highlight');

```
Looking at the [jQuery selector reference](http://docs.jquery.com/Selectors), I don't think  

`$('td[innerHTML=Dolares]')` and  

`$('td[html=Dolares]')` is going to work.

I can only think of iterating through all the TDs and check the `$(tdselector).html()` content.

You can try `contains("Dolares")` as suggested by tvanfosson though. It works for your case as it's highly unlikely you will have "xxDolaresxx" in other TDs.