title: getBoundingClientRect is not a function
body: <p>I am trying to get the coordinates of the mouse-click on a image.
  So I'm using getBoundingClientRect like this </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>function showCoords(canvas, event) {
      var rect = canvas.getBoundingClientRect();
      var x = event.clientX - rect.left;
      var y = event.clientY - rect.top;
      console.log("x: " + x + " y: " + y);
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>But I get this error "canvas.getBoundingClientRect is not a function"</p>