This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes why newly the attribute names of newly created DOM nodes are all lowercase? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "why newly the attribute names of newly created DOM nodes are all lowercase? " Watch "why newly the attribute names of newly created DOM nodes are all lowercase? " New topic
Author

why newly the attribute names of newly created DOM nodes are all lowercase?

Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
I have this problem under Firefox 3.6.17:


var oElem = document.createElement('newElem');
oElem.setAttribute('Name', 'chrix');
console.info(oElem);

the console string is <newelem name="chrix" />

why the element name and the 'name' attribute are all lowercase?


** SCJP 5.0 84% **
** SCWCD 1.5 76% **
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Why does it matter?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
Bear Bibeault wrote:Why does it matter?


if i expect the attribute name to be "Name", but it turns out to be "name", I don't think i can gets the attribute value
 
Consider Paul's rocket mass heater.
 
subject: why newly the attribute names of newly created DOM nodes are all lowercase?
 
Similar Threads
Form "action" issue / javascript question
Dropdown List and Command button
Dynamically created {input type=file}
error message when run jsp
Naming convention for JSP File