First of all, I am new to JS as a language itself, so this question may be really simple to answer, but my research has come to no avail.

Problem: I have a web page. This web page has multiple pictures. When the user places his mouse over the image and clicks (left or right click), another function is called.

What mouse event do I use to do this effectively and efficiently? I was thinking "mouseOver" or "mouseMove", but I'm not sure which one would work.


Function Mouse_LeftClick() {
if (mouseOverPicture()) { do something;}
Function Mouse_RightClick() {
if (mouseOverPicture()) { do something else;}

How exactly do I check if a mouse is over a picture at a click or not?