📜  清除画布内容 jquery - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:21.632000             🧑  作者: Mango

代码示例1
//set a const for all the code 
const context = canvas.getContext('2d');

//to clear the canvas use:
context.clearRect(0, 0, canvas.width, canvas.height);

//if the canvas is with 300 and height 450:
context.clearRect(0, 0, 300, 450);