Clicking Inside Canvas Element Selects Text
I have a canvas element in my HTML document. When I click inside of the canvas multiple times, it selects part of my
element's text, which is before the
Solution 1:
Returning false
in an event stops the standard event from happening:
document.getElementById('canvas').onmousedown = function(){
returnfalse;
};
Edit: I just found out that text selection is done before onclick
is fired, a better option is onmousedown
.
Post a Comment for "Clicking Inside Canvas Element Selects Text"