tags:

views:

32

answers:

4

Hi,

as topic says, how do I get a td in a table by it's title? I then want to hide it.

Thanks in advance.

A: 

By title as attribute: td[title="table title"]

By title as content: td:contains(table title)

Please be more explicit.

Ionut Staicu
+1  A: 

You could do this:

$('td[title=Herbert]').hide();
Pointy
+1  A: 
$("td[title='mytitle']").... 

look at this link :

http://api.jquery.com/attribute-equals-selector/

Haim Evgi
+2  A: 

Something like ...

$('table[title="the title"]').hide();

or if using the caption ...

$('table[caption="the caption"]').hide();

Bearing in mind the following:

If you wish to use any of the meta-characters (#;&,.+*~':"!^$=>|/ ) as a literal part of a name, you must escape the character with two backslashes: \\. For example, if you have an an input with name="names[]", you can use the selector $("input[name=names\\[\\]]").

As per Selectors - JQuery API

Rabid
sorry I misread as 'table by title', my jquery should read as `$('td[title="the title"]').hide();` so not to confuse anybody.
Rabid