Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12892 closed bug (notabug)

unchecked checkbox considered checked

Reported by: Markus.Staab Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description

I use a checkbox created from a html string. when calling .attr() on the created element it returns "checked", but the checkbox isn't checked?

see fiddle http://jsfiddle.net/mstaab/aZP6M/

Change History (4)

comment:1 Changed 7 years ago by Christian Meixner <christian.meixner@…>

Actually it is checked. You can see it, when you append it to the DOM: http://jsfiddle.net/aZP6M/1/

The "checked" attribute ist a bool attribute, which means it is true whenever it is present regardless of its value.

comment:2 Changed 7 years ago by dmethvin

Resolution: notabug
Status: newclosed

comment:3 Changed 7 years ago by Markus.Staab

hmmm you are right, can be closed as invalid.

comment:4 Changed 7 years ago by timmywil

Also, if you want the dynamic value, use the checked property. See http://api.jquery.com/prop for the difference.

Note: See TracTickets for help on using tickets.