HTML5 キャンバスを使用して描画する方法を学習し始めたばかりです。単純な正方形を作成しようとしていますが、空白の画面しか表示されず、Chrome コンソールでもエラーは発生しません。
<!Doctype html>
<html>
<head>
<title>Drawing to a canvas</title>
<script type="text/javascript" language="javascript" >
window.onload = draw;
function draw()
var canvas = document.getElementById("canvas1");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "rgba(0,200,0,1)";
ctx.fillRect = (36,10,50,50);
}
</script>
</head>
<body>
<canvas id="canvas1" width="400" height="300">
This text is displayed if your browser
does not support HTML5 Canvas.
</canvas>
</body>
</html>
これは非常に簡単に思えますが、私にはうまくいきません!