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

JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Build a Quiz Challenge, Part 2 Solution

Andrea Boscolo
Andrea Boscolo
7,250 Points

Maybe a stupid question...

Why in the first html = you got this right questions..... there are no opening and closing html tags but it anyway prints the phrase on the document?

1 Answer

nico dev
nico dev
20,364 Points

Hi Andrea Boscolo ,

It's not a stupid question. We are all learning here, and believe me the only way is making two things: questions and A LOT of mistakes. :)

The answer lies in the function print, which will basically get the element with the output id, and then replace its content (or in other words, its innerHTML ) with whatever you pass as an argument, in this case the html variable. Therefore, the text will go into the #output element.

Does that make sense?