var X = createElement('div');
document.body.appendChild(X);
var Y = createElement('div);
as an attachment to div X to div Y?
var X = createElement('div');
document.body.appendChild(X);
var Y = createElement('div);
as an attachment to div X to div Y?
Instead of document.body.appendChild(X);
(which attaches to body
), use:
Y.appendChild(X);