Multiple elements using the same click function at once. How?
===

I am using Raphael JS, but I think this is pure JavaScript or maybe jQuery question.

I have two elements a text and an circle(ellipse) and I am using a variable to store them for later usage.

So, I was thinking that instead of repeating myself over and over again I will create an array  and use it on click. 

But it is not working. How to solve this problem and assign onclick for every variable(object) in my array?

    var circle = paper.ellipse(350, 320, 95, 90);
    var text = paper.text(350, 320, "My text");
    
    var myArray = [circle, text];
    myArray.click(function () {
        window.location = "http://somewebsite.com";
    });