KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Using jQuery, how do you match elements that are prior to the current element in the DOM tree? Using prevAll() only matches previous siblings. eg: <table> <tr> <td class="findme">find this one</td> </tr> <tr> <td><a href="#" class="myLinks">find the previous .findme</a></td> </tr> <tr> <td class="findme">don't find this one</td> </tr> </table> In my specific case, I'll be searching for the first .findme element prior to the link clicked.
Tags (comma-separated)
Save Edits
Cancel