Find closest previous sibling with class


/ Published in: jQuery
Save to your folder(s)

$('li.current_sub').prevAll("li.par_cat:first");

Tested it with your markup:

$('li.current_sub').prevAll("li.par_cat:first").text("woohoo");

will fill up the closest previous li.par_cat with "woohoo".

URL: http://stackoverflow.com/questions/2310270/jquery-find-closest-previous-sibling-with-class

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.