Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAidi Xu
5,737 PointsWhy event.target.targetName('LI') the'li' needs to be capitalized?
event.target.targetName('LI')
Why the 'li' needs to be capitalized?
3 Answers
Bartlomiej Pajak
5,063 PointsAccording 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 Asmar
4,403 PointsBut why is that? Why must it be capitalised? I understand that that is what you do, but what is the reasoning for it?
Reggie Williams
Treehouse TeacherBec 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