开发者

dojo query for checkboxes

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 cl开发者_开发百科ass. 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.


What does the 'f' do in this case? I tried google for the parameters but couldn't find anything. – user1477388 Oct 11 '13 at 16:20

the second parameter of the query is the starting node for the query.

For instance, the query for < input > tags begins at "#{id:inputText1}" followed by the found nodes having the value of those found nodes, smited away with a null string.

dojo query for checkboxes

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜