Skip to main content

Bug Tracker

Side navigation

#9191 closed bug (fixed)

Opened May 09, 2011 12:08PM UTC

Closed May 09, 2011 03:16PM UTC

Last modified March 08, 2012 08:32PM UTC

attr checked difference

Reported by: arnaud@idweb.fr Owned by: arnaud@idweb.fr
Priority: low Milestone: 1.6.1
Component: attributes Version: 1.6
Keywords: Cc:
Blocked by: Blocking:
Description

the bug affect jquery 1.6 (no bug on jquery 1.5) :

HTML :

<form>

<input class="class1" type="radio" name="l1" value="0" checked="checked" />

<input class="class2" type="radio" name="l1" value="1" /><br />

<input class="class1" type="radio" name="l2" value="0" checked="checked" />

<input class="class2" type="radio" name="l2" value="1" />

</form>

JS :

$('.class2').attr('checked','checked'); this works on FF4 but not in I9

$('.class1').attr('checked','checked'); does not work

Attachments (0)
Change History (9)

Changed May 09, 2011 02:38PM UTC by timmywil comment:1

component: unfiledattributes
owner: → arnaud@idweb.fr
priority: undecidedlow
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsfiddle.net that reproduces the issue experienced to help us assess your ticket.

Additionally, test against the jQuery (edge) version to ensure the issue still exists.

Changed May 09, 2011 02:49PM UTC by anonymous comment:2

try it here : http://jsfiddle.net/6PxNR/

work with jquery 1.5.2

but bug with jquery 1.6

Changed May 09, 2011 03:16PM UTC by timmywil comment:3

milestone: 1.next1.6.1
resolution: → fixed
status: pendingclosed

This has been changed for 1.6.1, but I recommend using prop for dynamically changing the checked property. The checked attribute is technically only meant to store the default or initial value, which is why 1.6 behaves the way it does. We understand this caused confusion which is why jQuery in 1.6.1 will behave as it did previously, but prop is still recommended if for no other reason than it will be faster.

http://jsfiddle.net/timmywil/6PxNR/1/

Changed May 10, 2011 03:27PM UTC by timmywil comment:4

#9210 is a duplicate of this ticket.

Changed May 12, 2011 02:40PM UTC by timmywil comment:5

#9250 is a duplicate of this ticket.

Changed May 17, 2011 03:13PM UTC by timmywil comment:6

#9315 is a duplicate of this ticket.

Changed May 19, 2011 02:42PM UTC by timmywil comment:7

summary: attr checked bug on radioattr checked bug

Changed May 19, 2011 02:42PM UTC by timmywil comment:8

summary: attr checked bugattr checked difference

Changed May 19, 2011 02:42PM UTC by timmywil comment:9

#9259 is a duplicate of this ticket.