I have been working on a simple canvas-to-image exporter. You can find it here.
Currently, it only works with the following code:
<a id="download" download="CanvasDemo.png">Download as image</a>
However, I would like to use something like this instead:
<input id="download" value="Download" download="CanvasDemo.png" onclick="download()">
Unfortunately, when I try this, I receive an error: "Uncaught TypeError: download is not a function".
Is there a way for me to replace the "a" tag with a button?
I apologize if my question seems basic, I am still in the process of learning.
Thank you in advance.