Bug Tracker

Ticket #10038 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

attr returns undefined for disbaled on non input elements

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

As i understand it, attr should be setting and getting attribute on DOM elements, but this doesn't seem to be 100% true anymore with 1.6+. While I can set the attribute "disabled" on any element, trying to get that attribute returns undefined unless that element is a input. I would suspect this to be true of similar attributes that were changed in favor of prop. In this case, we are not trying to set an javascript property, rather a simple attribute on the element. I would think that i ought to be able to set/get any attribute regardless of name. This bug makes upgrading to 1.6 impossible for my company without MUCH pain.

Change History

comment:1 Changed 3 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to attributes

If set to false, it will remove the disabled attribute as even when set to false. With boolean attributes, its presence is what indicates value rather than its string value. However, if there is a bug in the code, please provide a reduced test case on  http://jsfiddle.net to help us assess the issue.

Note: See TracTickets for help on using tickets.