I\'m working on a canvas drawing project. I convert the canvas as an image, then I save that image as \'.png\'. I have to right click on the image and select the \'save imag
In modern browser you can use the download attribute
function save2() {
window.open(canvas.toDataURL('image/png'));
var gh = canvas.toDataURL('png');
var a = document.createElement('a');
a.href = gh;
a.download = 'image.png';
a.click()
}
just trigger the function from a button, or insert the anchor in the page and style it as a button.
FIDDLE