I am working with javascript / html and trying to fetch the text from a canvas object which is already created on the page.
I would like to click a button after the page is already loaded and see the text from the canvas object. Here is the code I am trying.
var CheckCanvas = document.getElementById(className);
var CheckContext = CheckCanvas.getContext('2d');
alert( 'btn text: ' + CheckContext.Text );
I have also tried fetching the 'fillText' property but I am unable to get the text from the object.
Any help would be much appreciated. I'm sure it's simple, but I could not find a solution.
Thanks.