Edit in JSFiddle

$("circle").click(function() {
    var randomRGB = function(){
        return Math.floor(Math.random() * 256).toString();
    };
    $(this).attr("fill", "rgb(" + randomRGB() + "," + randomRGB() + "," + randomRGB() + ")");
});
<h1>Click on the circle</h1>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
    <circle cx="50" cy="50" r="45" fill="#ff0000"></circle>
</svg>