Skip to main content

Bug Tracker

Side navigation

#11598 closed bug (wontfix)

Opened April 18, 2012 06:58AM UTC

Closed April 18, 2012 09:32AM UTC

$('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:
Description

eg.:

<li value='1'>abc</li>

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

Attachments (0)
Change History (2)

Changed April 18, 2012 07:35AM UTC by sindresorhus comment:1

owner: → anonymous
status: newpending

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.

Changed April 18, 2012 09:32AM UTC by addyosmani comment:2

component: unfiledattributes
priority: undecidedlow
resolution: → wontfix
status: pendingclosed

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) :)