title: Cannot set image src to dynamically created div
body: <p>I'm trying to set the background url of a div that was created on javascript. This will be used for Jquery Orbit slider. Here's how I do it.</p>
  
  <pre><code>var content 1 = null
  $("#featured").html("&lt;div id='content' style=''&gt;");
  content1 = document.getElementById("content");
  content1.style.background="url(" + imageUrlList[0] + ")";
  </code></pre>
  
  <p>imageUrlList came from this.</p>
  
  <pre><code>imageUrlList.push(document.getElementById("image1Container").src)
  </code></pre>
  
  <p>It gets the src from another image tag. So the goal is to get the src of the image tag and set it as background of a div (content) that was created via javascript. The problem is, it is not there. I tried looking at inspect element. The url is there, I think it is in base64, not sure. But it is there. What do you think is the problem? Any ideas? Thanks!</p>
  
  <p>UPDATE:
  I'm displaying an image when the user chooses an image on a file dialog. This image will be displayed on the image tag of image containers. These are the source images that I want to get and display them to the content div</p>
  
  <pre><code>function readURL(input, x) {
      if (input.files &amp;&amp; input.files[0]) {
          var reader = new FileReader();
  
  
          reader.onload = function (e) {
              if(x == 1)
              {$('#image1Container').attr('src', e.target.result);}
              else if(x == 2)
              {$('#image2Container').attr('src', e.target.result);}
              else if(x == 3)
              {$('#image3Container').attr('src', e.target.result);}
              else if(x == 4)
              {$('#image4Container').attr('src', e.target.result);}
              else
              {$('#image5Container').attr('src', e.target.result);}
  
          }
  
          reader.readAsDataURL(input.files[0]);
      }
  }
  </code></pre>