Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Chrix Wu
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does it matter?
 
Chrix Wu
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic