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 and the DOM (Retiring) Making Changes to the DOM DOM Manipulation

Robbie Thomas
Robbie Thomas
31,093 Points

On line 2 of app.js

I have the following code, but sadly, it says bummer.

Any help is appreciated. I also put "p" too and that didn't work.

app.js
const contentDiv = document.getElementById("content");
let newParagraph = document.CreateElement('p');
index.html
<!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>
eslam said
eslam said
Courses Plus Student 6,734 Points

so do you want to append the newParagraph to the empty div ?

2 Answers

let newParagraph = document.createElement("p");
Robbie Thomas
Robbie Thomas
31,093 Points

I actually input that at first with the "", and it told me wrong answer. I suppose the folks at TreeHouse made the mistake and fixed it in between the time I asked for help and I got the proper answer (in which I did provide).

I think the issue was the capitalization of createElement not the quotation marks, single quotes or double quotes should work

document.CreateElement('p');

vs

document.createElement('p');