Get td by title with jQuery?
as topic says, how do I get a t开发者_运维百科d in a table by it's title? I then want to hide it.
Thanks in advance.
You could do this:
$('td[title=Herbert]').hide();
$("td[title='mytitle']")....
look at this link :
http://api.jquery.com/attribute-equals-selector/
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
By title as attribute: td[title="table title"]
By title as content: td:contains(table title)
Please be more explicit.
精彩评论