title: I want to assign javascript variable to html element inside javascript
body: <p>I'm trying to insert javascript variable value in html element inside javascript.. But it's not working properly.. following are my code..</p>
  
  <pre><code> window.onload = function() {
      var image=document.getElementById('img').value;
          var img = '&lt;div id="pic"&gt;&lt;img src="image" width="200" height="108" /&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;';
        }
  </code></pre>
  
  <p>This is the function. Here i'm getting image in variable image.. i'm trying to assign this image to in one div id pic.. there i'm assigning src="image" which i got in var image.. But its not working.. </p>