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!
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 trial
element and elements
so to make it clear when we type elements and when element?
Is elements for multiple things we want to target or it would not be working if we don't add s behind element for getElementsByTagName, getElementsByClassName.
Is S only for class and TagName?
Steven Parker224,936 Points
Some functions return just one element, others return a collection of elements. The "s" in the function name will reflect that, and there will be only one correct spelling for each function. For examples:
getElementByID(no "s") returns only one element
getElementsByName(with "s") returns a collection