最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - finding a certain tr by attribute in an array of tr's - Stack Overflow

programmeradmin5浏览0评论

hi im trying to find a tr inside an array of tr's the attribute name is docId

is there anykind of jquery selector for this?

i dont want to just iterate throught the array with a for loop and find it myself.

unlesss you will say i have no choice...

thank you

hi im trying to find a tr inside an array of tr's the attribute name is docId

is there anykind of jquery selector for this?

i dont want to just iterate throught the array with a for loop and find it myself.

unlesss you will say i have no choice...

thank you

Share Improve this question edited Aug 18, 2010 at 6:12 Reigel Gallarde 65.3k21 gold badges125 silver badges142 bronze badges asked Aug 18, 2010 at 6:08 Guy SchallerGuy Schaller 4,7104 gold badges33 silver badges55 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

if you already have the array of trs on hand, and you got them through a jquery selector

array.filter('tr[attr=val]')

may be what you need.

$('tr[name=docId]')

That makes usage of the 'Attribute equals` selector. If your're dealing with a jQuery wrappet set, this is probably what you want.

Even, if that selector internally will also iterate over the set.

Ref.: Attribute Equals

发布评论

评论列表(0)

  1. 暂无评论