Skip to content

Instantly share code, notes, and snippets.

@hayatbiralem
Created July 25, 2013 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hayatbiralem/6078474 to your computer and use it in GitHub Desktop.
Save hayatbiralem/6078474 to your computer and use it in GitHub Desktop.
[jQuery] Selecting all but first-child
// Source: http://forum.jquery.com/topic/jquery-selecting-all-but-first-child
// Most easy to understand, get all li elements except for the first one.
$("li:not(:first-child)")
// Get all li elements and slice off the first
$("li").slice(1)
// Get all li elements that are prepended by an li
$('ul li+li')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment