title: The drag-and-drop element gets stuck to the cursor in older Internet Explorer
body: <p>To reproduce the bug, open the following web-app in Internet Explorer 6 (and I believe the same error appears in some later versions of Internet Explorer, because it also appears in the Internet Explorer 11 when run in Compatibility Mode, which is supposed to emulate Internet Explorer 8):<br/>
  <a href="http://flatassembler.000webhostapp.com/compiler.html" rel="nofollow noreferrer">http://flatassembler.000webhostapp.com/compiler.html</a> <br/>
  Now, in the top right corner, you should see three buttons.<br/>
  Click the first one to the left, the "minimize" button.<br/>
  In the bottom middle of the page, there should be a draggable icon that can be double-clicked to "deminimize" the web-app. In most of the browsers, you can drag it by pointing to that icon, pressing the left mouse button, and moving it around, and then releasing the left mouse button. In Internet Explorer 6 and Internet Explorer 11 run in Compatibility Mode (and I suppose some other browsers I haven't tested it in) what happens is that the icon gets stuck to the cursor even after you've released the left mouse button, and you need to click it again to make the icon stop following the cursor.<br/>
  Do you have an idea what is going on? Is there a quick-fix? Here is the code I've used to make the drag-and-drop feature work:<br/></p>
  
  <pre><code>&lt;!-- ... --&gt;
  &lt;div id="ikona"
              style="text-align:center; display:none; position:absolute; color:white; font-family:Arial; font-size:10px;"&gt;
              &lt;img src="https://www.theflatearthsociety.org/forum/avr/avatar_1461509_1483220545.png" alt="AEC" style="width:75px;" draggable="false"/&gt;&lt;br/&gt;
              &lt;span id="opis"&gt;Arithmetic&lt;br/&gt;Expression&lt;br/&gt;Compiler&lt;/span&gt;
          &lt;/div&gt;
          &lt;script type="text/javascript"&gt;
      //...
  document.getElementById("smanji").onclick=function() { //The "minimize" button.
                      //...
          document.getElementById("ikona").style.display="block";
                      document.getElementById("opis").style.backgroundColor="transparent";
                      document.getElementsByTagName("nav")[0].style.display="none";
                      document.getElementById("ikona").style.left=document.body.clientWidth/2-document.getElementById("ikona").offsetWidth/2;
                      document.getElementById("ikona").style.top="auto";
                      document.getElementById("ikona").style.bottom="8px";
                  }
          //...
          if (!(/(M|m)obile/.test(navigator.userAgent))) {
          //...
          document.getElementById("ikona").onclick=function()
                      {
                          document.getElementById("opis").style.backgroundColor="blue";
                      }
                      document.getElementById("ikona").onmousedown=function()
                      {
                          dragInit(this);
                      }
          //...
      }
      //...
          var isFirefox=false;
          var selected;
          var x_pos = 0;
          var y_pos = 0;
          var x_elem = 0;
          var y_elem = 0;
          function dragInit(elem) {
              selected = elem;
              x_elem = x_pos - selected.offsetLeft;
              y_elem = y_pos - selected.offsetTop;
          }
          function moveElement(e) {
              if (!window.event) {
                  isFirefox=true;
                  window.event=new Object();
              }
              if (isFirefox)
              {
                  window.event.clientX=e.clientX;
                  window.event.clientY=e.clientY;
              }
              x_pos = window.event.clientX;
              y_pos = window.event.clientY;
              if (selected) {
                  selected.style.left = (x_pos - x_elem) + 'px';
                  selected.style.top = (y_pos - y_elem) + 'px';
              }
          }
          function destroy(e) {
              if (!window.event) {
                  isFirefox=true;
                  window.event=new Object();
              }
              if (isFirefox)
              {
                  window.event.clientX=e.clientX;
                  window.event.clientY=e.clientY;
              }
              if (window.event.clientX&lt;document.getElementById("ikona").style.left.substring(0,document.getElementById("ikona").style.left.length-2)*1
                  || window.event.clientX&gt;document.getElementById("ikona").style.left.substring(0,document.getElementById("ikona").style.left.length-2)*1+document.getElementById("ikona").offsetWidth
                  || window.event.clientY&lt;document.getElementById("ikona").style.top.substring(0,document.getElementById("ikona").style.top.length-2)*1
                  || window.event.clientY&gt;document.getElementById("ikona").style.top.substring(0,document.getElementById("ikona").style.top.length-2)*1+document.getElementById("ikona").offsetHeight)
                      document.getElementById("opis").style.backgroundColor="transparent";                selected = null;
          }
          document.onmousemove = moveElement;
          document.onmouseup = destroy;`
  //...
      &lt;/script&gt;
  &lt;!-- ... --&gt;
  </code></pre>
  
  <p>For a few visitors to my website who are still using older versions of Internet Explorer...</p>