Chapter 3: Red square

JavaScript

var paper = Raphael(0, 0, 500, 500);
var mysquare = paper.rect(25, 25, 250, 250).attr("fill", "red");
mysquare.mouseover(function(e) {
this.attr("fill", "blue");
}).mouseout(function(e) {
this.attr("fill", "red");
});