<canvas id="c" width="300" height="150"></canvas>
<script>
const ctx = document.getElementById('c').getContext('2d');
ctx.fillStyle = 'teal';
ctx.fillRect(10, 10, 100, 60);
</script>Tip
Contrast with SVG: canvas is pixel-based and imperative; SVG is vector-based and part of the DOM.