Bug Tracker

Modify

Ticket #11598 (closed bug: wontfix)

Opened 2 years ago

Last modified 2 years ago

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

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

Description

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

Change History

comment:1 Changed 2 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 2 years ago by addyosmani

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

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.

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.