26th Dec 2018, 5:44 PM
Vipin Gautam
Vipin Gautam - avatar
5 odpowiedzi
+ 2
I wouldn’t recommend doing it this way as it may lead to some confusion but here you go. You have parentheses in the wrong places. It should be: document.getElementById("demo").appendChild(document.createElement("p")).appendChild(document.createTextNode("HI"));
26th Dec 2018, 6:38 PM
Diego
Diego - avatar
+ 2
Please paste your codes in the Code Playground and share the links. It would make it easier for people to help you. Thanks!
26th Dec 2018, 5:55 PM
Diego
Diego - avatar
+ 2
...what Diego Acero wrote, and you can add this to the end of your scripts to examine the generated HTML for clues: setTimeout(function(){alert(document.all[0].outerHTML)}, 50);
26th Dec 2018, 5:59 PM
Kirk Schafer
Kirk Schafer - avatar
0
Diego Acero ans Kirk Schafer now check it please...
26th Dec 2018, 6:10 PM
Vipin Gautam
Vipin Gautam - avatar
0
Diego Acero Thank you so much I was just trying what might be some other ways to achieve the same result.
26th Dec 2018, 6:45 PM
Vipin Gautam
Vipin Gautam - avatar