Syntax error How to prevent text select outside HTML5 canvas on double-click?

How to prevent text select outside HTML5 canvas on double-click?



To avoid the double click text issue −

var canvas1 = document.getElementById('c');
canvas1.onselectstart = function () {
   return false;
}

Note − The Canvas should not fill the width of the page and it is only 100 pixels wide.

Updated on: 2020-06-25T07:53:07+05:30

341 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements