+ 1

I want to create paragraph and heading element in my script. I have error. Thanks you.

Create heading and paragraph element. https://code.sololearn.com/WhhoMyVLIGCR/?ref=app

14th Jan 2021, 7:13 AM
Malick Diagne
Malick Diagne - avatar
2 Respostas
+ 3
Error: You wrote "document.creatElement" instead of "document.createElement" at line 8 and 10. The rest is explained by Avinesh
14th Jan 2021, 7:15 AM
Baspberry
+ 1
1) Check the spelling of createElement. 2) You must append the element to the body to see it on the page. var heading = document.createElement ("h1"); heading.innerHTML = "JavaScript" ; document.body.appendChild(heading); var paragraph = document.createElement ("p"); paragraph.innerHTML = "Content"; document.body.appendChild(paragraph);
14th Jan 2021, 7:18 AM
Avinesh
Avinesh - avatar