1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<!DOCTYPE html> <html> <head> <script> function boom() { var ctx = document.querySelector("canvas").getContext('2d'); ctx.strokeRect(0.5, 1, 2, 3); } </script> </head> <body onload="boom();"><canvas width="100" height="100"></canvas></body> </html>