title: Draw circle on click in canvas
body: <p>Hi I'm trying to create a code that draws a circle when a user clicks on the canvas element. So when a user clicks on the canvas element a circle is drawn within canvas.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var canvas =document.querySelector('canvas');
  var c = canvas.getContext('2d');
  
  
  var putLeaves = function() {
  c.beginPath();
  c.arc(300,300,30,0,Math.PI*2,false);
  c.fillStyle ="#d57b85"
  c.fill
  }
  
  canvas.addEventListner('mousedown', putLeaves)</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#canvas{
  position: absolute;
  left: 44%;
  top: 15%;
  margin: 0;
  border: 1px solid black;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;canvas id="canvas" width="300" height="200"&gt;&lt;/canvas&gt;</code></pre>
  </div>
  </div>
  </p>