Appendto() And Append() Works, Appendchild() Does Not
As part of a drag-and-drop file upload interface, showImage is called when a file is dropped on the target container. showImage checks that the file is an image, reads the file, cr
Solution 1:
querySelectorAll()
returns a node list. To get the first element, access it by index:
var dropTarg = document.querySelectorAll('.drop-container')[0];
dropTarg.appendChild(newImg);
Some error handling to make sure it found something would probably be in order.
Post a Comment for "Appendto() And Append() Works, Appendchild() Does Not"