Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12704 closed bug (notabug)

:checked is considering drop down select also

Reported by: thulasirams1986@… 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

Jsfiddle: http://jsfiddle.net/nanoquantumtech/SZFvC/

Change History (4)

comment:1 Changed 6 years ago by timmywil

Component: unfiledselector
Keywords: needsdocs added
Resolution: notabug
Status: newclosed

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.

comment:2 Changed 6 years ago by mikesherov

Keywords: needsdocs removed

comment:3 Changed 6 years ago by timmywil

#12784 is a duplicate of this ticket.

comment:4 Changed 6 years ago by timmywil

FYI, documentation issue has been opened here: https://github.com/jquery/api.jquery.com/issues/99

Note: See TracTickets for help on using tickets.