What I'm trying to accomplish:
First, an image:
There is a textbox underneath the 'code' tab - what I want is for all the canvas-related code written inside the HTML to be displayed on the canvas on the right.
My problem:
I'm struggling with doing so, I tried doing this:
run.addEventListener('click', function() {
canvas.innerHTML = '<script>' + jsarea.value + '</script>';
})
But it didn't work. I'm also getting a 'Cannot read property 'getContext' of null' error on:
var ctx = canvas.getContext('2d');
I think this might be because the canvas is in an iframe.
How could I achieve what I'm trying to accomplish?