| <!DOCTYPE html> | |
| <html> | |
| <body style="font-family: Ahem"> | |
| <canvas id="onscreen" width="100" height="10""></canvas> | |
| <script> | |
| const canvas = document.getElementById('onscreen'); | |
| const context = canvas.getContext('2d'); | |
| const square = new Path2D(); | |
| square.rect(0, 0, 100, 10); | |
| context.fillStyle = 'green'; | |
| context.fill(square); | |
| </script> | |
| </body> | |
| </html> |