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
selecting 'body' by document.getElementsByTagName
const body = document.getElementsByTagName(body); is the right anwer for the question ' How do you select the body' by document.getElementsByTagName?' in the quiz. I get it until (body) but what is the purpose of  in here. we are just selecting the whole 'body' why don't we just write const body = document.getElementsByTagName(body); and finish the code here?
document.getElementsbyTagName will return a list of elements and not a single element.
Even if there is only one element with that tag name it will be in a Node List which is why you have to use the  to get the particular one.
I recommend open the console of any webpage and type
const body = document.getElementsbyTagName('body'); then
console.log(body) it will return the whole HTML Collection but if you will
const body = document.getElementsbyTagName('body'); and then
console.log(body) it will return the exact body element.
It's been stored in