jquery to find all exact td matches

前端 未结 5 1484
陌清茗
陌清茗 2021-02-09 00:31
$(\'#servertable td:eq(\' + server + \')\')

this finds only 1 (first I think) match, how to find all matches. btw. td:contains will not work for me.

5条回答
  •  梦谈多话
    2021-02-09 00:47

    I too encountered this very same problem as the original author. As Paulo the original question poser had. Which selector can I use to match elements based equality check on element contents. At least I presume that's what he did (as did I) try to achieve and that would also explain why he (as well as I) can't use contains for the obvious reasons ra170 pointed out in his comment. Anyhow if someone happens to stumble here looking for the answer to that question here's the short answer to it:

    jQuery has no such matcher by default. The solution is to define your own matcher. To tackle the problem at hand see this excellent blog post by Motte.

提交回复
热议问题