SPlatten
SPlatten

Reputation: 5758

jquery selector including parent id

I have a form with 3 select lists, I'm using the jquery multipleSelect addon to select lists using checkboxes, I want to be able to select all selections from a specific group, I can do this for everything on the page using:

    $('input[type=checkbox]')

Can I select all checkboxes from a group by including the id of the parent node?

I'm open to other methods of achieving the same.

Upvotes: 0

Views: 47

Answers (1)

Anoop Joshi P
Anoop Joshi P

Reputation: 25527

Yes you can do,

 $('.parentclassname input[type=checkbox]')

Or

 $('#parentId input[type=checkbox]')

Or

$(parentselector).find('input[type=checkbox]')

Upvotes: 1

Related Questions