views:

31

answers:

2

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

+1  A: 
$('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

jAndy
where is the array in all this?...the tr's are not in the html.
guy schaller
@guy: well you're right actually. But a `jQuery wrapped set` also represents an Array. So my guess was, you're dealing with such a structure. Otherwise the word `jQuery selector` would really be confusing and infact wrong in the question.
jAndy
+2  A: 

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.

Andrew Matthews
thanks man! you are correct
guy schaller