events in javascript

JavaScript
//this is an event detector for a mouseclick with Jquery
$('#id').on('click',function(){
    yourFunction(args);
});
Source

Also in JavaScript: