jQuery select all except first

$("div.test:not(:first)").hide();

or:

$("div.test:not(:eq(0))").hide();

or:

$("div.test").not(":eq(0)").hide();

or:

$("div.test:gt(0)").hide();

or: (as per @Jordan Lev’s comment):

$("div.test").slice(1).hide();

and so on.

See:

  • http://api.jquery.com/first-selector/
  • http://api.jquery.com/not-selector/
  • http://api.jquery.com/gt-selector/
  • https://api.jquery.com/slice/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)