본문 바로가기

html | javascript

html javascript - clear canvas

 let canvas = document.getElementById('id-canvas')
 let ctx = canvas.getContext('2d')
 
 
 function clear() {
   ctx.clearRect(0, 0, canvas.width, canvas.height)
 }