javascript - Clicking inside canvas element selects text -


In my HTML document I have a canvas element when I click inside the canvas several times, it will be my & Lt; H1 & gt; selects the element of the text of the element, which is & lt; Canvas & gt; Is there a way to prevent it from happening before the tag? I'm guessing that JavaScript is the solution.

Returning the incorrect in an event prevents a standard occurrence:

  document.getElementById ('canvas'). Onmousedown = function () {return false; }; Edit: I have just discovered that the text code has been removed from  onclick , a better option is  onmousedown    / P> 

Comments