Software, Music and Thoughts
Drum & Bass Producer, Software Developer, Love my Cats
View my complete profile
HTML5: How to clear canvas
I have an HTML5 canvas element and I want to 'reset' it, clear the content.
How do you clear a canvas element?
1. get the canvas from the DOM:
canvas = document.getElementById("canvas");
2. reset canvas:
canvas.width = canvas.width;