Can't getContext of canvas
===

I'm facing a problem when i want to get the context of a canvas.
Here is the HTML code:

    <canvas id="thecanvas" width="600" height="300"></canvas>

and the Javascript:

    var canvaso = document.getElementById('thecanvas');
    if (!canvaso) {
        alert('Error: Cannot find the canvas element!');
        return;
    }
    if (!canvaso.getContext) {
        alert('Error: Canvas context does not exist!');
        return;
    }

The "canvaso" variable is correctly loaded, but it failed on "canvaso.getContext":

    Uncaught TypeError: Object #<HTMLDivElement> has no method 'getContext' 

Thanks for your help.