I would like to know how to draw 100 rectangles with SVG.
I made one rectangle with this code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<svg id="svgOne" xmlns="http://www.w3.org/2000/svg" width="5000" height="3000">
<rect x="50" y="50" width="50" height="50" fill="black" />
</svg>
</body>
</html>
I woukd like to draw 100 of rectangles with same size, different position (like 10 in row and 10 rows). How to do it fast? Some loop?
You can fill the screen with the following loop:
If you just want 100 randomly placed squares, you could do:
jsfiddle for the second one