Hi, I have a question about dynamically creating a canvas using javascript.
I create a canvas like this:
var canvas = document.createElement('canvas'); canvas.id = "CursorLayer"; canvas.width = 1224; canvas.height = 768; canvas.style.zIndex = 8; canvas.style.position = "absolute"; canvas.style.border = "1px solid";
but when I try to find it, I get null :
cursorLayer = document.getElementById("CursorLayer");
Am I doing it wrong? Is there a better way to create a canvas using JavaScript?
javascript html html5 canvas
Arjen van Heck May 18 '12 at 12:18 2012-05-18 12:18
source share