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 Interactive Web Pages with JavaScript Traversing and Manipulating the DOM with JavaScript Appending and Removing Elements

Challenge task 2 of 2 - After line 9, append the newParagraph to the body.

Hi, does anyone have an answer to this. Nothing is working and I can't find an answer.

Thanks

Hi Oliver,

What code are you trying?

All sorts at the moment.... maybe it's late! I think I'm trying to alter this...

var listItem = this.parentNode; completedTasksHolder.appendChild(listItem);

but not getting anywhere.

5 Answers

Hi, I've cracked it...

body.appendChild(newParagraph);

Glad you figured it out.

I'm not sure if you've linked to the right challenge here.

Do you have something like this for task 1?

body.removeChild(pleaseEnableParagraph);

Task 2 is very similar to that but you would use appendChild() instead and you would be appending newParagraph

Thanks, I made a meal of task 1, so task 2 wasn't obvious.

body.appendChild(newParagraph);

bummer: Did you use the appendChild() method on the body .

please assist me this is the response i am getting on the above code

Hi Elda,

Where did you place that code? I tried your code for task 2 and it passes fine.

hey Elda your code works also tried it and it worked.

hie Jason Sorry for late response but i think my network was just bad, coz it worked later. Tafadzwa, it did later. Thanks guys