Can't obtain div style width or height
<p>I don't know why but I can't set the canvas width and height, and am not sure what I am doing wrong.</p>

<p>I create the page like this:</p>

<pre><code>//create div
var d = document.createElement('div'); 
d.id = 'G';
d.className = 'GameOuput';  
document.getElementById('E').appendChild(d);    

var i = 1;
var c = document.createElement('canvas');
    c.id = 'layer' + i;
    c.className = 'c';
    c.style['z-index'] = i;

    document.getElementById('G').appendChild(c);  

    console.log(document.getElementById('G').style.width);  
    c.width = document.getElementById('G').style.width;
    c.height = document.getElementById('G').style.height; 
</code></pre>

<p>The the canvas shows:</p>

<pre><code>&lt;canvas id="layer1" class="c" style="z-index: 1;" width="0" height="0"&gt;&lt;/canvas&gt;
</code></pre>

<p><code>console.log(document.getElementById('G').style.width);</code> = blank</p>

<p>What am i doing wrong here??</p>
