title: Events attached to object inside canvas
body: <p>I have simply canvas code which draw rect on the canvas</p>
  
  <pre><code>var x=document.getElementById("canvas");
  var ctx=x.getContext("2d");
  ctx.rect(20,20,150,100);
  ctx.stroke();
  </code></pre>
  
  <p>is it possible to add eventListener on said rect? For example, if I click on rect, it will turn red.</p>