Bind() is the methode to attach the event
.bind(event type, event handler)
In the following example,
bind attaches the event handler to the click event by selecting all
elements that contain the class
mylink. When the event is invoked, it triggers the alertMe
function:
$
(document).ready(function(){
$
(‘.mylink’).bind(click, alertMe);
function
alertMe() {
alert
(“Hello World”);
}
});enjoy
No comments:
Post a Comment