Dojo request for checkboxes

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

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

I want to add another selector (class selector) so that all checkboxes are checked in the form with the specified class. I tried this one but it does not work.

 var cbs = dojo.query('input:checked .xClass', 'f');
+3
source share
2 answers

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

Pseudo selectors, such as :checked, act as filters and should be placed as suffixes of other selectors. You can first select the checkboxes with the specified class using input.xClass, and then add :checkedas a suffix.

+4
source

What does f do in this case? I tried google options but didn't find anything. - user1477388 Oct 11 '13 at 16:20

node .

, <input> "# {id: inputText1}", , , .

enter image description here

0

Source: https://habr.com/ru/post/1746132/


All Articles