Bug Tracker


Opened 5 years ago

Closed 5 years ago

#11598 closed bug (wontfix)

$('li').removeAttr('value');//IE Error

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


eg.: <li value='1'>abc</li> $('li').removeAttr('value');IE Error

Change History (2)

comment:1 Changed 5 years ago by sindresorhus

  • Owner set to anonymous
  • Status changed from new to pending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 5 years ago by addyosmani

  • Component changed from unfiled to attributes
  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from pending to closed

Please note that use of the value attribute on <li> elements has been deprecated for quite some time (HTML 4.01) http://www.w3.org/TR/1999/REC-html401-19991224/struct/lists.html#h-10.2.

In my opinion, rather than trying to fix this issue, I recommend the OP use data attributes for storing values instead as these are more flexible. $(el).removeAttr() appears to work fine for other cases where value is still semantically valid.

(If anyone strongly disagrees with this, please feel free to reopen) :)

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

Modify Ticket

Change Properties

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

Note: See TracTickets for help on using tickets.