I am trying to find a <td>
where the value is 5. It is a calender so there will only be one 5 value.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use filter method:
$('td').filter(function(){
return $(this).text() === '5'
})
回答2:
Use the :contains selector:
var td = $("td:contains('5')");
Edit:
This will also select the td with 15
and 25
, if you want exact 5
, then use the .filter
method as the other answer said.