jQuery access each matched element from '.find' by an index
- by GHarping
Using jQuery's .find() method to return a set of elements, I am trying to access items in the returned set by their order in that set.
For example, a table with two rows and in each row a select box and two text input fields, accessed with the following:
$('table#tbl').find('tr.row').each(function(i)
{
});
To get the first element I would have thought I could use
$('table#tbl').find('tr.row').each(function(i)
{
alert( $(this).find(':input').get(1).val() );
});
And variations of the above, but apparently this doesn't work. Could anyone suggest the correct method to access item x of n elements returned?