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!
I think what you're saying is that you want events to occur when you click on objects you have drawn on a canvas. I have written a few [tutorials](http://simonsarris.com/blog/140-canvas-moving-selectable-shapes) on how to make persistent shapes and move them around with mouse clicks. That should give you a good starting point for this.