Im trying to export a canvas to a png but Im not sure if when calling for the canvas as a class i get the right return:
var canvas = document.getElementsByClassName('filemanager');
canvas.setAttribute('crossOrigin', 'anonymous');
function download() {var dt = canvas.toDataURL();
this.href = dt; //this may not work in the future..}document.getElementById('download').addEventListener('click', download, false);
In the html i have: <a id="download" download="YourFileName.jpg">Download as image</a>
I read somewhere about how when calling functions you do not get back the same desired return, is the document.getElementById()
different from document.getElementsByClassName()
in terms of what you receive back?