Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>Practice JavaScript by drawing</title>
- </head>
- <body>
- <canvas id="myCanvas" height="300" width="450" style="border: 1px solid black"></canvas>
- <script id="jsbin-javascript">
- var canvas = document.getElementById('myCanvas');
- var context = canvas.getContext('2d');
- context.beginPath();
- context.moveTo(300, 200) ;
- context.lineTo(230,100);
- context.strokeStyle = 'grey';
- context.stroke();
- context.moveTo(175, 200) ;
- context.lineTo(230,100);
- context.strokeStyle = 'grey';
- context.stroke();
- context.moveTo(175, 200) ;
- context.lineTo(300,200);
- context.strokeStyle = 'grey';
- context.stroke();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">var canvas = document.getElementById('myCanvas');
- var context = canvas.getContext('2d');
- context.beginPath();
- context.moveTo(300, 200) ;
- context.lineTo(230,100);
- context.strokeStyle = 'grey';
- context.stroke();
- context.moveTo(175, 200) ;
- context.lineTo(230,100);
- context.strokeStyle = 'grey';
- context.stroke();
- context.moveTo(175, 200) ;
- context.lineTo(300,200);
- context.strokeStyle = 'grey';
- context.stroke();
- </script></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement