문제

I am trying to find a <td> where the value is 5. It is a calender so there will only be one 5 value.

도움이 되었습니까?

해결책

You can use filter method:

$('td').filter(function(){
    return $(this).text() === '5'
})

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top