First of all I got a simple solution that works for me to draw a canvas-element.
The code looks like this in HTML:

```
...
<td align="center" class="TableUnten" id="Gesamtleistung0">
            <canvas id="myCanvas"></canvas>                
            <script type="text/javascript">
                drawCanvas("myCanvas");
            </script>
</td>
...

```

and here in js:

```
function drawCanvas(canvasname) {
    var cv = document.getElementById(canvasname);
    var ctx = cv.getContext('2d');
    //...

```

This works and the canvas will be shown in the table.

But now I want to make the function call in a seperate .js-file. So I thought this could work:

```
function tester() {
    document.getElementById("Gesamtleistung0").innerHTML = drawCanvas("myCanvas");
}

```

The problem is that the variable cv doesn´t contain the name of the canvas-element "mycanvas" but shows "null". Whereas the variable canvasname is declared with "myCanvas".

Do you have any ideas what I can do to call my canvas-drawing-function and then put it into a table?

Thanks