O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Filtering Items Based on Index

$("div#content").eq(1);   //selects the second element found by the selector

The .eq(index) filter will return the element at a specific index in the jQuery object’s set. The index is zero based, so .eq(1) actually retrieves the second element found by the selector.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required