Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Nav

Nav

1 Answer

#slideshow > div

means select all div children of #slideshow

console.log($('#slideshow > div')); // = [ div, div, div]

The code above puts all the selected elements in an array.

:gt(0)

selects all the elements Greater Than the index specified. GT = greater than

$("#slideshow > div:gt(0)");

means select all the div children of #slideshow that are greater than index 0.... So it will not select the first one.

some great documentation to browse through. https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Selectors https://api.jquery.com/gt-selector/

Nav