/ Published in: jQuery
URL: http://stackoverflow.com/questions/2310270/jquery-find-closest-previous-sibling-with-class
$('li.currentsub').prevAll("li.parcat:first");
Tested it with your markup:
$('li.currentsub').prevAll("li.parcat:first").text("woohoo");
will fill up the closest previous li.par_cat with "woohoo".
Expand |
Embed | Plain Text
$('li.current_sub').prevAll("li.par_cat:first");
You need to login to post a comment.
