function event js code example
Example 1: javascript event listener
element.addEventListener("click", function(){
element.innerText = "something";
});
Example 2: events in javascript
//this is an event detector for a mouseclick with Jquery
$('#id').on('click',function(){
yourFunction(args);
});