Skip to main content

Bug Tracker

Side navigation

#12704 closed bug (notabug)

Opened October 11, 2012 01:05PM UTC

Closed October 15, 2012 04:02PM UTC

Last modified October 23, 2012 06:22PM UTC

:checked is considering drop down select also

Reported by: thulasirams1986@gmail.com 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/

Attachments (0)
Change History (4)

Changed October 15, 2012 04:02PM UTC by timmywil comment:1

component: unfiledselector
keywords: → needsdocs
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.

Changed October 15, 2012 08:07PM UTC by mikesherov comment:2

keywords: needsdocs

Changed October 23, 2012 06:21PM UTC by timmywil comment:3

#12784 is a duplicate of this ticket.

Changed October 23, 2012 06:22PM UTC by timmywil comment:4

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