Display a "Hello World!" alert box. : trigger « jQuery « JavaScript DHTML






Display a "Hello World!" alert box.

 

$("p").bind("myEvent", function (event, message1, message2) {
  alert(message1 + ' ' + message2);
});
$("p").trigger("myEvent", ["Hello","World!"]);

   
  








Related examples in the same category

1.Trigger Another Event
2.Triggered By Select Change Event
3.Trigger handler
4.Triggers the blur event of each matched element
5.Trigger Submit Event
6.Trigger a custom event
7.trigger(type , data )
8.To submit the first form without using the submit() function