Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>Practice JavaScript by drawing</title>
  7. </head>
  8. <body>
  9. <canvas id="myCanvas" height="300" width="450" style="border: 1px solid black"></canvas>
  10. <script id="jsbin-javascript">
  11. var canvas = document.getElementById('myCanvas');
  12. var context = canvas.getContext('2d');
  13.  
  14. context.beginPath();
  15. context.moveTo(300, 200) ;
  16. context.lineTo(230,100);
  17. context.strokeStyle = 'grey';
  18. context.stroke();
  19. context.moveTo(175, 200) ;
  20. context.lineTo(230,100);
  21. context.strokeStyle = 'grey';
  22. context.stroke();
  23. context.moveTo(175, 200) ;
  24. context.lineTo(300,200);
  25. context.strokeStyle = 'grey';
  26. context.stroke();
  27. </script>
  28.  
  29.  
  30.  
  31. <script id="jsbin-source-javascript" type="text/javascript">var canvas = document.getElementById('myCanvas');
  32. var context = canvas.getContext('2d');
  33.  
  34. context.beginPath();
  35. context.moveTo(300, 200) ;
  36. context.lineTo(230,100);
  37. context.strokeStyle = 'grey';
  38. context.stroke();
  39. context.moveTo(175, 200) ;
  40. context.lineTo(230,100);
  41. context.strokeStyle = 'grey';
  42. context.stroke();
  43. context.moveTo(175, 200) ;
  44. context.lineTo(300,200);
  45. context.strokeStyle = 'grey';
  46. context.stroke();
  47. </script></body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement