+ 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
2 Respuestas
+ 3
Error: You wrote "document.creatElement" instead of "document.createElement" at line 8 and 10.
The rest is explained by Avinesh
+ 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);