This is part of the SVG Tutorial and exercises drawing square in SVG.

Actually a square is just a rectangular where all the 4 sides are the same length, but the color is much nicer here.

examples/js/svg_square.js

function draw_square() {
    var draw = SVG('square_1');
    draw.size(120, 120);
    var square = draw.rect(100, 100);
    square.attr({ fill: '#f06' });
}

draw_square()