Bug Tracker

Modify

Ticket #7257 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

.attr('checked') does not work as expected for application/xhtml+xml documents

Reported by: kieran@… Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocking: Blocked by:

Description

It is impossible to use .attr('checked') to read and modify checkbox states for documents that have the application/xhtml+xml content type. Instead, it returns "checked" or "undefined" depending on whether the checked="checked" attribute is specified for the tag. A boolean true/false was expected.

If the document is sent as text/html, it works as expected.

I have tested it in both Firefox and Google Chrome with the same result.

Example:  http://caffie.net/checkbox/index.xhtml

Change History

comment:1 Changed 3 years ago by anonymous

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

The true/false magic for .checked is a DOM1 HTML behavior and not supported in XHTML.

Dup of #4283 where it is discussed ad nauseum.

comment:3 Changed 3 years ago by dmethvin

Duplicate of #4283.

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.