title: Preloading images and adding class
body: <p>I am using the following code to preload my images:</p>
  
  <pre><code>function preload(sources)
  {
    var images = [];
    for (i = 0, length = sources.length; i &lt; length; ++i) {
      images[i] = new Image();
      images[i].src = sources[i];
    }
  }
  </code></pre>
  
  <p>How can I add a class to the image object? I tried images[i].class = 'classname', but this doesn't do the trick. Any suggestions?</p>
  
  <p>Thanks!</p>