Question: Something like I am have:

```

    function mouseClick(event) {
        ...
    }
    canvas.addEventListener("mousedown", mouseClick, false);
    function drawRect(x, y) {
        context.fillRect(x, y, 16, 16);
    };
    drawRect(10, 10);

```

How to do something like if I am click on my Rect in Canvas get something? something like If I am click on Rect get alert;

Sorry for my English language.

Answer: 
```
$(canvas).mousedown(function myDown(e) 
{
  var position = $(canvas).position();
  var x = e.pageX-position.left;
  var y = e.pageY-position.top;
  ...
});

```

This is much better way to do this!
`addEventListener` is tricky. What I would try is 

`canvas.addEventListener.apply(canvas, ["mousedown", mouseClick, false]);`

or use an anonymous function.

`canvas.addEventListener.apply(canvas, ["mousedown", function(){ mouseClick(); }, false]);`

Using the apply function can help make sure the `eventListener` is applied to the right element. You can read about it [here](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/function/apply).