I wanted to do a canvas and a line but the JavaScript console says: “null is not an object (evaluating ‘c.getContext’)”.
// HTML code:
<!DOCTYPE html>
<html>
<head>
<script src="provaCanvas.js" type="text/javascript"></script>
</head>
<body>
<canvas id="canvas-id" width="200" height="100"
style="border: solid 1px black;"></canvas>
</body>
</html>
// JavaScript code:
var c = document.getElementById("canvas-id");
var ctx = c.getContext('2d')
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();