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 trial

JavaScript

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
228,978 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.