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

JavascriptWeb DevelopmentFront End Scripts

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.

Published on 06-Apr-2018 16:07:23