Skip to content Skip to sidebar Skip to footer

Appendchild Does Not Work

First of all: I'm not much schooled with javascript. So have a problem with the appendChild method. That's my code: var wrapper = document.getElementsByClassName('innerWrap'); var

Solution 1:

getElementsByClassName returns an NodeList, not a Node

So you could try var wrapper = document.getElementsByClassName('innerWrap')[0];

Solution 2:

Have you tried

wrapper.appendChild(post);

instead of

document.wrapper.appendChild(post); 

?

Post a Comment for "Appendchild Does Not Work"