Javascript – Multi-Conditional Selectors in jQuery


I'm trying to select elements with multiple conditions, for example I'm doing the following at the moment:


Although I know you can do things like $('#myspan input:visible') but it didn't work for me. I need to check for inputs within the span #myspan which are visible and are checked. Any ideas?

Best Solution


$("#myspan :checked:visible").each(function() {
    // do stuff