Why event.target.targetName('LI') the'li' needs to be capitalized?
Why the 'li' needs to be capitalized?
Bartlomiej Pajak5,062 Points
According to MDM:
' The tagName read-only property of the Element interface returns the tag name of the element on which it's called. For example, if the element is an <img>, its tagName property is "IMG" '
I hope it helps.
Bec Asmar4,402 Points
But why is that? Why must it be capitalised? I understand that that is what you do, but what is the reasoning for it?
Reggie WilliamsTreehouse Teacher
Bec Asmar it looks like Seth has a great answer here https://teamtreehouse.com/community/why-does-the-tagname-need-to-be-in-caps-when-using-eventtargettagname