tags:

views:

87

answers:

1

Hi I want to get all my checked checkboxes from a form and i do like this(and it works)

var cbs = dojo.query('input:checked', 'f');

I wand to add another selector(class selector) to get all checked checkboxes from a form with a specified class. I tried this one but it doesn't work

 var cbs = dojo.query('input:checked .xClass', 'f');
A: 

Try this dojo.query('input.xClass:checked', 'f');

Pseudo-selectors like :checked act like filters and should be put as suffixes of other selectors. You can select checkboxes with a specified class first using input.xClass, then append the :checked as the suffix.

Alex Cheng