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 trialMichał Pyszyński
8,208 PointsCode challenge - DOM Manipulation problem
I have encountered some problem in a code challenge. I had to create a new paragraph and assign it to new variable in JS file. I have done it correctly because i can change it text content (3, 4), but when i click "Check work" - I'm getting this error: Bummer: Make sure that you assign a '<p>' element to 'newParagraph'.
Screens:
- https://gyazo.com/fa966078ae0df861186fb5108bf89b2b
- https://gyazo.com/3e2930dd6c351cfa28f2af852ca3db9f
- https://gyazo.com/96f65950ff281e03a98b74f53f11bec9
- https://gyazo.com/347c159d5a83b33d15501d6500a8128d
Gif:
Have I done something wrong or is it a bug?
2 Answers
Ignacio Rocha
7,462 PointsActually you didn't do it correctly. In the first challenge task you have to CREATE a paragraph element using Javascript, all you did was create it directly in the html
the right way is using the createElement method.
var newParagraph = document.createElement('p');
Michał Pyszyński
8,208 PointsI see. Thank you for answer! I thought i had to create paragraph in HTML file.