title: converting contents of a div into an image
body: <p>I am creating an image editor type web application. I have a main <code>div</code> which will contain many <code>div</code> inside it. </p>
  
  <p>When the user clicks on a save button, I want to save the main <code>div</code> as an image in a folder.
  I tried doing it using <code>Canvas.toDataURL()</code> but then I found that i cant place a div(main div) inside canvas tags. I also tried <code>imagegrabscreen()</code> function of php but it captured the screen before the whole page is loaded, so it was of no use.</p>
  
  <p>Can anybody help me and suggest a way to implement this using php or javascript?</p>