title: How do I change an image dynamically?
body: <p>I'm working on a little banner thing and my main image is not displaying</p>
  
  <p>The code seems to be working correctly, yet nothing is showing up.</p>
  
  <p>Any help would be most appreciated.</p>
  
  <pre><code>var urlString = 'url(images/mainphoto' + ss_i + '.jpg)';
  var obj = document.getElementById("mainphoto");
  obj.style.background = urlString;
  //document.getElementById("mainphoto").style.backgroundImage = "url('images/mainphoto" + ss_i + ".jpg')";
  console.log(urlString);
  </code></pre>
  
  
  
  <pre><code>&lt;div id="mainphoto"&gt;&lt;/div&gt;
  </code></pre>
  
  
  
  <pre><code>#mainphoto {
      background:url(images/mainphoto0.jpg);
      position: absolute;
      margin-top: 149px;
      z-index: 0;
  }
  </code></pre>