tags:

views:

65

answers:

3

I have this jQuery which gives me a set of INPUT items.

var list = $("input[name*='popSearch']")

How would I modify it to only return those where the INPUT element is checked ?

+3  A: 

var list = $("input[name*='popSearch']:checked");

See the documentation on selectors.

Dan
+4  A: 

Hi,

first docs.jquery.com is a fanstastic resource,

however to your request this should work,

var list = $("input[name*='popSearch'] :checked")
Pharabus
This shouldn't work, it's looking for a `:checked` element *inside* the input. But it's the input itself that can be checked. Dan has it right, without the space.
bobince
+3  A: 

I think this should do it:

var list = $("input[name*='popSearch']:checked")
brendan