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.

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.