0

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 Answers 3

4

first docs.jquery.com is a fanstastic resource,

however to your request this should work,

var list = $("input[name*='popSearch'] :checked")
Sign up to request clarification or add additional context in comments.

1 Comment

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.
3

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

See the documentation on selectors.

Comments

3

I think this should do it:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.