Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Line Breaks

After running the script and inspecting the code in the browser, it seems as though the Javascript printed the ordered list in a nice format with each list item on a different line to the HTML. I am confused because we didn't tell the loop print the list items on different lines. Is the inspect tool simply displaying the code in this fashion although we don't have the list items on different lines in the HTML, or is the JavaScript printing out the list items to different lines in our HTML without us telling it to?

1 Answer

Steven Parker
Steven Parker
220,450 Points

Lines in an HTML file don't correspond to lines shown on the page.

By default, list items appear on the page on separate lines no matter how they appear in the HTML file.

For specific help, always show your code or link to a snapshot, and provide a link to the course page if the question relates to a course.