title: Onclick save canvas as image on server
body: <p>I have this canvas. I have written some javascript that allows the user to draw on the canvas in different colors and pen sizes. </p>
  
  <pre><code>&lt;style&gt;
  #myCanvas{
  position:absolute;
  top:0px;
  left:0px;
  border:1px solid black;
  z-index:0;
  }
  &lt;/style&gt;
  
  &lt;canvas id="myCanvas" width="900" height="600"&gt;&lt;/canvas&gt;
  </code></pre>
  
  <p>How would I have the user click on a button or an input with <strong>type="button"</strong> and have the image save to the server?</p>