clearRect function doesn’t clear the canvas

You should use “beginPath()“. That is it. function lineDraw() { var canvas=document.getElementById(“myCanvas”); var context=canvas.getContext(“2d”); context.clearRect(0, 0, context.width,context.height); context.beginPath();//ADD THIS LINE!<<<<<<<<<<<<< context.moveTo(0,0); context.lineTo(event.clientX,event.clientY); context.stroke(); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)