BrU32

JS Random Rect Drawing SRC V1

Jun 15th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <canvas id="myCanvas" width="500" height="500"
  6. style="border:1px solid #c3c3c3;">
  7. Your browser does not support the canvas element.
  8. </canvas>
  9.  
  10. <script>
  11. var i=prompt("Enter # Of Times To Scramble Canvas:");
  12. for(var i1=0;i1!=i;i1++){
  13. var canvas = document.getElementById("myCanvas");
  14. var ctx = canvas.getContext("2d");
  15. ctx.fillStyle = "#FF0000";
  16. ctx.fillRect(Math.random()*100,Math.random()*100,Math.random()*100,Math.random()*100);
  17. }
  18. </script>
  19.  
  20. </body>
  21. </html>
Advertisement
Add Comment
Please, Sign In to add comment