iterator - How to remove the last element of a jQuery selection? -
i use jquery selector :
$('#menus>ul>li>a')
i'd to iterate selector result without last one:
$('#menus>ul>li>a').removelast().each(fct());
ofcourse function "removelast()" doesn't exist, there equivalent ?
thanks.
you can use :not
selector or .not()
method:
$('#menus>ul>li>a:not(:last)')
or
$('#menus>ul>li>a').not(":last")
Comments
Post a Comment