I'm starting to build a grid using HTML5 and JS, but this doesn't work?
<p>Apparently this doesn't work, and since I'm new to HTML5 I'm unsure as to why. I should get some vertical lines on the canvas. The idea is to build a grid on the canvas screen to work from, but this doesn't seem to be creating the lines for some reason.</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Test App&lt;/title&gt;


&lt;style&gt;
body {
    padding:0px;
    margin:0px;

}
canvas {
    border:1px solid #000000;

}

&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;canvas id="gc" width="800" height="600"&gt;&lt;/canvas&gt;

&lt;script&gt;
    function buildGrid() {
        alert("Start!");
        var gameCanvas = document.getElementById("gc");
        var ctx = gameCanvas.getContext("2d");

        for (x=5; x&lt;gameCanvas.width; x+=5) {
            console.log(x);
            ctx.moveTo(x, 10);
            ctx.lineTo(x, gameCanvas.length);
        }




        ctx.strokeStyle = "black";
        ctx.stroke();


    }
    window.onload = buildGrid();
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>