开发者

how to group multiple filter selectors?

开发者 https://www.devze.com 2023-03-19 03:16 出处:网络
How can I select first checked checkbox from div with class \"site\"? I guess it should be 开发者_开发知识库something like that but this doesnt work:

How can I select first checked checkbox from div with class "site"?

I guess it should be 开发者_开发知识库something like that but this doesnt work:

$(".site :checkbox :checked :first")


remove the spaces

$(".site :checkbox:first:checked")


Use $('.site input:checkbox:checked:first")

It searches for input tags that are checked checkboxes below .site and then returns the first element that matches these criteria.


$(".site input[type='checkbox']:checked:first")

Demo: http://jsfiddle.net/TRAk2/

Use the Attribute Equal Selector to select the type of an input.


$(".site :checkbox")[0].checked);

Demo: http://jsfiddle.net/nyus6/

0

精彩评论

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