Hi I'm doing a drawing app using canvas but i dunno how to clear canvas. I've tried clearRect and other functions but they don't work. The last two function of the script should clear canvas but they don't work... (sorry for my bad english) Here the code:
function clear_canvas_width ()
{
var s = document.getElementById ("scribbler");
var w = s.width;
s.width = 10;
s.width = w;
}
function clear_canvas_rectangle ()
{
var canvas = $('#canvas')[0]; // or document.getElementById('canvas');
canvas.width = canvas.width;
}