Ticket #9804 (closed enhancement: worksforme)
.attr() takes only lowercase attribute names (in IE)
| Reported by: | gulgil | Owned by: | gulgil |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | attributes | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
By a random accident I put in "ID" (uppercase) as an attribute name and apparently IE8 and IE9 won't accept that. FF and Crome have no problem... Attributes should be case-insensitive, thou it is recommended to use lowercase by W3.
Example can be seen here: http://demo.athena-cms.dk/jqueryAttrTest.html
In short it is these 2 lines that fails div.attr("ID", "testID1") alert($(this).attr("ID"))
In IE you will get an empty value. Change "ID" to "id" and it works.
I propose a toLowerCase function to always be used on attribute names. At least in IE browsers...
Change History
comment:1 Changed 23 months ago by rwaldron
- Owner set to gulgil
- Priority changed from undecided to low
- Status changed from new to pending
- Component changed from unfiled to attributes
comment:2 Changed 23 months ago by gulgil
- Status changed from pending to new
I did create create a jsFiddle here: http://jsfiddle.net/JMMfU/
But that works, so I could not use it.
Im new to jsFiddle, so maby it can create a real test page, that will fail. I just dont know how... It was easier for me to create a real page, than using hours to find out how jsFiddle works...
comment:3 Changed 22 months ago by addyosmani
- Status changed from new to closed
- Resolution set to worksforme
As we've been unable to reproduce the issue you've described on jsFiddle.net using jQuery (edge/git) and it's been almost two weeks since the last response on this ticket, we're going to be closing it as worksforme. If you're able to provide us with additional information, test cases that can reproduce the behaviour experienced etc. we'll be happy to take another look at this.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket! If you could transfer your test to jsfiddle - that would be fantastic.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, I've created this boilerplate: http://jsfiddle.net/rwaldron/da3nM/ Open the link and click to "Fork" in the top menu.