on eventsin javascript code example
Example: events in javascript
//this is an event detector for a mouseclick with Jquery
$('#id').on('click',function(){
yourFunction(args);
});
//this is an event detector for a mouseclick with Jquery
$('#id').on('click',function(){
yourFunction(args);
});