0
I made the code below to create a canvas that draws in its space a red rectangle. However, nothing appears. I can’t find any syntax error. I’m using Google Chrome:
<!DOCTYPE html>
<html>
<body>
<p> Antes da Canvas </p>
<canvas width="120" height="60"></canvas>
<p> Depois da canvas </p>
<script>
var canvas = document.querySelector("canvas");
var context = canvas.getContext("2d");
context.fillStyle = "red";
context.fillRect = (10, 10, 100, 50);
</script>
</body>
</html>
Another abandoned question. Do not abandon questions because you may get a bad image in the community.
– Sam