$('#parent').find('span,div').filter(':last');
or
$('#parent').find('span,div').slice(-1);
Ariel Flesler
On 6 mar, 14:37, apramanik [EMAIL PROTECTED] wrote:
Hi all,
I'm new to JQuery and want to do the following:
Given the following html:
div id=parent
div/div
div/div
div/div
So my thinking was that, to use a different example,
$( '#parent' ).children( 'span:last' )
would be faster then
$( '#parent' ).children( 'span' ).filter( ':last' )
The latter would traverse the children and create an array of span
elements, then apply the filter.
The former would just
2 matches
Mail list logo