Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#9191 closed bug (fixed)

attr checked difference

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

Change History (9)

comment:1 Changed 6 years ago by timmywil

  • Component changed from unfiled to attributes
  • Owner set to arnaud@…
  • Priority changed from undecided to low
  • Status changed from new to pending

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.

comment:2 Changed 6 years ago by anonymous

try it here : http://jsfiddle.net/6PxNR/ work with jquery 1.5.2 but bug with jquery 1.6

comment:3 Changed 6 years ago by timmywil

  • Milestone changed from 1.next to 1.6.1
  • Resolution set to fixed
  • Status changed from pending to closed

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/

comment:4 Changed 6 years ago by timmywil

#9210 is a duplicate of this ticket.

comment:5 Changed 6 years ago by timmywil

#9250 is a duplicate of this ticket.

comment:6 Changed 6 years ago by timmywil

#9315 is a duplicate of this ticket.

comment:7 Changed 6 years ago by timmywil

  • Summary changed from attr checked bug on radio to attr checked bug

comment:8 Changed 6 years ago by timmywil

  • Summary changed from attr checked bug to attr checked difference

comment:9 Changed 6 years ago by timmywil

#9259 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.