I'm new to Javascript so I apologize for this relatively easy question. I have a picture that I'm interested in appending to the bottom of a container (wrapper). I've experimented with append(), appendChild(), prepend() with relatively little success, so I'm wondering if it's the sequence I'm declaring things or just another bug.
$("#imageLocation").appendTo(wrapper);
img.setAttribute("src", params.imageurl);
img.setAttribute("class","imagelink");
document.getElementById("imageLocation").appendChild(img);
imageLocation, imagelink have all been declared in my CSS file, but I'm getting the following error: Uncaught TypeError: Cannot call method 'appendChild' of null.
What other things should I be looking at? Thanks!