title: JS: Can't remove created Element in IE
body: <p>I'm dynamically creating an image via javascript like this:</p>
  
  <pre><code>var dragimg = null;
  function createImage(g) {
      dragimg = document.createElement("img");
      dragimg.src = "link/to/image.png";
      dragimg.style.width = "50px";
      dragimg.style.position = "absolute";
      dragimg.style.zIndex = 100;
      $("body").prepend(dragimg);
  }
  </code></pre>
  
  <p>After creating the Image, I want to remove it at some point by calling this function:</p>
  
  <pre><code>function removeImage() {
  dragimg.remove();
  }
  </code></pre>
  
  <p>This works well in Chrome, Firefox &amp; Opera. However, it doesn't work in <strong>Internet Explorer 11</strong>.</p>
  
  <p>I'd also like to point out I have an <code>document.onmousemove</code> function set which manipulates the left and top attribute of the created image when the mouse moves. This works well in all browsers - but I'm not sure if it has something to do with the remove-problem.</p>
  
  <p>I've also tried to remove the image by <code>dragimg.parentNode.removeChild(dragimg)</code>, but same result.</p>