user796443
user796443

Reputation:

How do I exclude first ten and last 1 li from hide() jquery

So far I've this:

$(".actor ul li").not($(".actor ul li").slice(0,11)).hide();

I also would like to exclude last li from hide(). How would I do that? obvious answer would be to also show :last. But there should be an elegant way to do this :)

Upvotes: 0

Views: 33

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388346

Try

$(".actor ul li").not(':lt(10), :last').hide();

Upvotes: 3

Related Questions