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 trialPrem Gurusamy
2,342 PointsI didn't understand , what they're asking here?
I couldn't solve it, please help me
const contentDiv = document.getElementById("content");
let newParagraph = document.createElement('p');
<!DOCTYPE html>
<html>
<head>
<title>DOM Manipulation</title>
</head>
<link rel="stylesheet" href="style.css" />
<body>
<div id="content">
</div>
<script src="app.js"></script>
</body>
</html>
2 Answers
Steven Parker
231,248 PointsIt looks like you're on task 2.
Task 2 says, "Set the class of panel
to the newParagraph
." Maybe the wording is confusing. What if I restated it this way: "Give the newParagraph
you just created a class with the name panel
." — would that help?
If you're just not sure how to give an element a class attribute, there are some options. One way is by assigning the className property of the element, and another is to call the classList.add() method.
I'll bet one of those hints will get you going.
Ker Zhang
Full Stack JavaScript Techdegree Graduate 29,113 PointsYes, the wording of this task is really confusing. I didn't know what to do until I saw Steven's explanation. Thanks!
The answer is simple: newParagraph.className = 'panel';
Kirkland Harrell
4,444 PointsKirkland Harrell
4,444 PointsWhich challenge task couldn't you solve? 1, 2 or 3?