Bug Tracker

Modify

Ticket #9130 (closed bug: worksforme)

Opened 2 years ago

Last modified 2 years ago

In the 1.6 release, checkbox operation error

Reported by: tester Owned by: tester
Priority: low Milestone: 1.next
Component: attributes Version: 1.6
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by timmywil) (diff)

In IE9, $ ("#checkBox1"). Attr ('checked') is the value of, other mainstream browsers did not return the correct value, tested the Firefox,Chrome,Opera, are disabled, but old version 1.3.2 you properly under any browser.

Change History

comment:1 Changed 2 years ago by timmywil

  • Owner set to tester
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to attributes
  • Description modified (diff)

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 2 years ago by addyosmani

  • Status changed from pending to closed
  • Resolution set to worksforme

I've put together a test-case here  http://jsfiddle.net/9Wyy8/1/ that's been tested in latest Firefox, Chrome, Opera and IE9 using our current edge version. The value of $("#checkBox1").attr('checked') is consistent for me across all browsers (and returns the values we expect).

Just a few notes:

  • Changes have been made to .attr() since the 1.6 release was pushed and the behavior you experience in our current edge version vs. 1.6 differs
  • jQuery 1.6 came with a change to the way attr('checkbox') would work. See below for a quote from our release notes:

Before jQuery 1.6, .attr("checked") returned the Boolean property value (true) but as of jQuery 1.6 it returns the actual value of the attribute (an empty string), which doesn’t change when the user clicks the checkbox to change its state.

comment:3 Changed 2 years ago by anonymous

I also like that, looking forward to your feedback

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.