Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dojo query for checkboxes

Tags:

dojo

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');
like image 679
mouse Avatar asked Jul 21 '26 11:07

mouse


1 Answers

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.

like image 127
Alex Cheng Avatar answered Jul 24 '26 06:07

Alex Cheng