title: Handling OnClick event for canvas in javascript and getting its coordinates
body: <p>I have a canvas for drawing like that</p>
  
  <p><code>&lt;div id="canvas" style="position:relative;width:600px;height:300px;" onclick="q()"&gt;&lt;/div&gt;</code> </p>
  
  <p>I need to handle the event when clicking on it and get the coordinates on the canvas where it was clicked</p>