A way to chain selectors like this in jQuery? inpu

2019-08-14 04:29发布

问题:

I want to get all inputs that are checked and not hidden

This doesn't work:

.formyform input:checked:not(:hidden)

Is there a simple way to do it?

I couldn't find any example on the jQuery site

回答1:

What you have should work, though you can simplify it with :visible:

.formyform input:checked:visible

You can test it out here.