Selecting an object at a specific index with jQuery
July 6, 2010 Category: jQuery TipsAs you probably know, the jQuery selector returns all the matched elements as an array. But what if you needed to select only the third element in the returned elements list?
The code below will return only the 3rd element in the returned selected list
// get 3rd item as a jQuery object: $('div:eq(2)') // get 3rd item as a pure DOM object $('div')[2];
0 comment
Tags: javascript, jQuery —

