title: HTML5 Dynamically create Canvas
body: <p>Hi there I have a question about dynamically creating a canvas using javascript.</p>
  
  <p>I create a canvas like this:</p>
  
  <pre><code>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";
  </code></pre>
  
  <p>but when I try to locate it, I get a <code>null</code> value:</p>
  
  <pre><code>cursorLayer = document.getElementById("CursorLayer");
  </code></pre>
  
  <p>Am I doing it wrong? Is there a better way to create a canvas using JavaScript?</p>