[Solved] How can I make a point and let it disappear when making a new point
You can use ctx.clearRect(0, 0, c.width, c.height); to clear the content. function showCoords(event) { i++; var x = event.clientX; var y = event.clientY; var c = document.getElementById(“myCanvas”); var ctx = c.getContext(“2d”); ctx.clearRect(0, 0, c.width, c.height); console.log(x,y); var coords = “X coords: ” + x + “, Y coords: ” + y; document.getElementById(“demo”).innerHTML = coords; if(i%2==0) … Read more