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 Working with Strings Variables and Strings Challenge Solution

Jason Widjaja
Jason Widjaja
7,904 Points

what is <p> for?

t

Joseph Hookham
Joseph Hookham
2,493 Points

It's a HTML tag which puts your text into a paragraph (on the webpage). If you haven't done the HTML & CSS basics I'd recommend that - it'll make more sense.

You could also use <h1></h1> or <h2></h2> tags etc. for different formatting options.

5 Answers

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Rohald van Merode
Treehouse Staff

Hi Jason,

The <p> tag is the HTML code for paragraph, so this will insert the finished sentence as a paragraph text in the HTML file.

Hope this cleared things up.

This displays the sentence as a paragraph within the HTML file.

Rick Gleitz
Rick Gleitz
47,876 Points

Don't forget the </p> at the end of the paragraph's text!

Also if you are asking this type of question about HTML tags, you need to take a step back and go over the basic HTML courses before venturing on to JavaScript.

The HTML <p> element represents a paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs can be any structural grouping of related content, such as images or form fields.