jQuery can't access the svg elements directly you can use this library: keith-wood.name/svg.html
mentioned here: How to use jquery in SVG (Scalable Vector Graphics)?
or you can simple use following built in Rapahel click function to achieve the result you are seeking:
var r = Raphael("canvas",500,500);
var rectangle = r.rect(10, 10, 100, 100).attr({fill:'red'}).click(function(){
//click function statements
this.toFront();
});