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');
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With