Chapter 3: Red square
JavaScript
var paper = Raphael(0, 0, 500, 500);
var mysquare = paper.rect(25, 25, 250, 250).attr("fill", "red");
function turnMeBlue(p) {
this.attr("fill", "blue");
}
mysquare.click(turnMeBlue);
var paper = Raphael(0, 0, 500, 500);
var mysquare = paper.rect(25, 25, 250, 250).attr("fill", "red");
function turnMeBlue(p) {
this.attr("fill", "blue");
}
mysquare.click(turnMeBlue);