Returning false
in an event stops the standard event from happening:
document.getElementById('canvas').onmousedown = function(){
return false;
};
Edit: I just found out that text selection is done before onclick
is fired, a better option is onmousedown
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…