title: Draw a canvas into another canvas not working
body: <p>I am trying to draw a canvas created through javascript on another canvas. But it is not working for me,</p>
  
  <p>Here is my code,</p>
  
  <pre><code>    &lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;/script&gt;
         &lt;script&gt;
          window.onload = function(){  
          var can1 = document.createElement('canvas');
          can1.width = 150;
          can1.height = 140;
          can1.style.cssText = 'top:2px;left:2px;border:2px  solid black;';
  
          var ctx1 = can1.getContext('2d');
          var img=new Image();
          img.src="images/211.jpg"
          ctx1.drawImage(img,0,0);
  
          var can = document.getElementById("c");
          var ctx = can.getContext('2d');
          ctx.drawImage(can1,0,0);
          var canvas =  document.getElementById("c"); 
          window.open(canvas.toDataURL());
          }
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body &gt;
      &lt;canvas id="c" style = "position:absolute;top:150px;width:250px;height:350px;left:500px; border:2px  solid black;"&gt;&lt;/canvas&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>