1function download() {
2var download = document.getElementById("download");
3var image = document.getElementById("myCanvas").toDataURL("image/png")
4 .replace("image/png", "image/octet-stream");
5download.setAttribute("href", image);
6//download.setAttribute("download","archive.png");
7}