save image as javascript code example
Example: save image jpg javascript
<a download="example.jpg" href="" onclick="downloadCanvas(this);">Download example.jpg</a>
async function downloadCanvas(el) {
const imageURI = canvas.toDataURL("image/jpg");
el.href = imageURI;
};