Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. code example

Example: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

appendchild is only can appened node error, is because you are trying to pass string
con='You cant doing without problems,dont close the lid of the lap, SEARCH'
p="<p>"+con+"</p>"
body.append(p)
THis wont work, Eventhough "<p>"+con+"</p>" can create a paragraph still
it is a string.So, try
p=document.createElement("p")
p.textContent="You cant doing without problems,dont close the lid of the lap, SEARCH";
body.append(p);
This will work, Iam a loser if I able to do, 'You' definitely can.

Tags:

Misc Example