How do determine which action or event is taking place when you have the following code
$('#mydiv').on('click mousedown mousemove', function(event) { //<--multiple event
if (action is mousedown) {
}
else if(action is mousemove){
}
else{
//mouse click
}
});
jsFiddle example welcomed.
event.typewill get the event type as a string:You can also just do: