Coolenough
Coolenough

Reputation: 533

bind property in jquery - identify the Events

Hi can someone help me how exactly a bind understands an event passed for example,

$("#example_button").bind("click",function(){
    alert("Event is  clicked");
})

$("#example_button").bind("mouseover",function(){
    alert("Event is mouseover");
})

How exactly bind figures(identifies) the event.... i mean is there any way to identify a event...

Upvotes: 2

Views: 99

Answers (1)

Ajay Singh Beniwal
Ajay Singh Beniwal

Reputation: 19037

See the type attribute on the jQuery event object:

$("a").click(function(event) {
  alert(event.type); // "click"
}); 

Upvotes: 3

Related Questions