I have two selectors
var allNodes = $("a.historyEntry");
var errorNodes = $("a.historyEntry.error");
I would like to to find a node before first error node, so I need to find an index of first error node, how to do it?
I tried to use inArray method, but it doesn't work for this
$.inArray(allNodes, errorNodes.first())
or
$.inArray(allNodes, $(errorNodes.first()))
Is there any fast way to do it in jQuery or do I have to use for loop?
allNodes
have theerror
class, and you want to find the last "good" node before the first "error" node. Is that right? – Chyle