views:

902

answers:

2

Assuming I have a tree structure

UL
--LI
---INPUT (checkbox)

And I want to grab the checked inputs, I would select

$('ul li input:checked')

However, I want to select the checked inputs of a specific object $myUL that doesn't have an ID.

$myUL.children('li input:checked')

returns all li's since children filters immediate children - the checked filter has no impact.

Is there another way around this? Another descendant filter?

+1  A: 

use $myUL.find('li>input:checked')

redsquare
A: 

$myUL.find('li>input:checked') work as expected. Any trade off of performance?

LockeVN