#12704 closed bug (notabug)
:checked is considering drop down select also
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | selector | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
<select> <option value="0" selected="selected">Or</option> <option value="1">And</option> </select>
<select> <option value="0">Or</option> <option value="1">And</option> </select>
<input type="checkbox" checked="checked" />
<input type="checkbox" />
==============================
$(document).ready(function(){
alert($(':checked').length+ ' ' + $(':checkbox:checked').length+' '+$(':selected').length);
});
==============================
Output:
3 1 2
Change History (4)
comment:1 Changed 10 years ago by
Component: | unfiled → selector |
---|---|
Keywords: | needsdocs added |
Resolution: | → notabug |
Status: | new → closed |
comment:2 Changed 10 years ago by
Keywords: | needsdocs removed |
---|
comment:4 Changed 10 years ago by
FYI, documentation issue has been opened here: https://github.com/jquery/api.jquery.com/issues/99
Note: See
TracTickets for help on using
tickets.
This is desired behavior and the design of the
:checked
selector.http://www.w3.org/TR/selectors/#checked
However, this is a jQuery documentation issue. We will make an issue on api.jquery.com.