title: Monitoring background image load pure javascript
body: <p>I have a simple code:</p>
  
  <pre><code>&lt;div id="dk" style="background-image: url('d.jpg');"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I would like to monitory this div loading and when it success do something and if the load take more then 5 seconds do otherthing.</p>
  
  <p>I was trying to do :</p>
  
  <pre><code>document.getElementById('dk').addEventListener('loadeddata', function () {
          //do something
      }, false);
  </code></pre>
  
  <p>But i belive that it works just for vídeos and áudios. Otherhand it will get just when it is complete.</p>