Skip to main content

Bug Tracker

Side navigation

#12892 closed bug (notabug)

Opened November 14, 2012 09:10AM UTC

Closed November 14, 2012 12:52PM UTC

Last modified November 14, 2012 03:18PM UTC

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/

Attachments (0)
Change History (4)

Changed November 14, 2012 09:35AM UTC by Christian Meixner <christian.meixner@bippesbrandao.de> comment:1

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.

Changed November 14, 2012 12:52PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed

Changed November 14, 2012 12:52PM UTC by Markus.Staab comment:3

hmmm you are right, can be closed as invalid.

Changed November 14, 2012 03:18PM UTC by timmywil comment:4

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