title: Add an Id to a background-image inside a div
body: <p>I am trying to add an id to a background image that is inside a div in order to have it fade in on load.</p>
  
  <pre><code> &lt;div class="thumbnail" style="background-image:url(images/bracelets/1/002.png,); width:356px; height:265px;"&gt;&lt;a id="thumbnail-btn" href="images/bracelets/1/002a.png" rel="lightbox" title="my caption"&gt;&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>This is what I have on my code and what I want to add an id to is the:</p>
  
  <pre><code>background-image:url(images/bracelets/1/002.png,) 
  </code></pre>
  
  <p>I have several background-images on the page that I want to fade in at the same time. Can anyone help me or tell me if its possible to add an id to it. Because this is the code I want to use to fade in.</p>
  
  <pre><code>document.write("&lt;style type='text/css'&gt;#thephoto {visibility:hidden;}&lt;/style&gt;");
  
  var images = [ "thephoto1", "thephoto2", "thephoto3" ];
  function initImages() {
      for (var i = 0; i &lt; images.length; i++) {
          imageId = images[i];
          image = document.getElementById(imageId);
          setOpacity(image, 0);
          image.style.visibility = "visible";
          fadeIn(imageId, 0);
      }
  }
  function fadeIn(objId,opacity) {
      if (document.getElementById) {
          obj = document.getElementById(objId);
          if (opacity &lt;= 100) {
              setOpacity(obj, opacity);
              opacity += 10;
              window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
          }
      }
  }
  function setOpacity(obj, opacity) {
      opacity = (opacity == 100)?99.999:opacity;
      // IE/Win
      obj.style.filter = "alpha(opacity:"+opacity+")";
      // Safari&lt;1.2, Konqueror
      obj.style.KHTMLOpacity = opacity/100;
      // Older Mozilla and Firefox
      obj.style.MozOpacity = opacity/100;
      // Safari 1.2, newer Firefox and Mozilla, CSS3
      obj.style.opacity = opacity/100;
  }
  window.onload = function() {initImage()}
  // --&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>If anyone has a better idea of how to do it I would really appreciate it!</p>
  
  <p>Thanks!
  S.</p>