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 JavaScript Basics (Retired) Working With Numbers The Random Challenge Solution

Michael L
Michael L
2,482 Points

Why does var message have "<p>" and "</p>"?

Not really sure why var message has "< p >" and "< / p >" inside quotation marks?? Do we want the program to not create a paragraph but to print "< p >"? kind of got lost in this line - can you please clarify?

Thanks in advance!

P.S. I am referring to Dave's solution code to the challenge, var message line.

Michael L
Michael L
2,482 Points

had to put spaces in < p > b/c otherwise they disappear... :)

3 Answers

Michael L
Michael L
2,482 Points

Thank you Russ - still seems to work - those "< p >"s confused me...

Russ Fleharty
seal-mask
.a{fill-rule:evenodd;}techdegree
Russ Fleharty
Python Web Development Techdegree Student 10,815 Points

You don't actually have to use "<p>" and "</p>". It's more for aesthetics in my opinion. Try deleting them and see how the text changes.

Lewis Cowles
Lewis Cowles
74,902 Points

because var message is being used to store a string with HTML in it so that when it is written to DOM (directly or indirectly), it has a container HTML Element I would assume