StepsEasy
HTML Canvas - Example
Run
Reset
Destroy & Close
← Back to lesson
Code Editor
html
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000"> </canvas> <script> var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.fillStyle = "#FF0000"; ctx.fillRect(0, 0, 150, 75); </script>
Result
Click "Run" to execute the code...
Loading runtime...
Ready
HTML | In-Browser Execution