Javascript examples for Canvas:Line
Set canvas line width, stroke style and draw rectangle
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*www.ja v a 2 s.co m*/ var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); ctx.strokeStyle = "#CCCC00"; ctx.lineWidth = 15; ctx.strokeRect(0, 0, 300, 100); }); </script> </head> <body> uhhh... <canvas id="canvas"></canvas> </body> </html>