HTMLify

Events.js
Views: 39 | Author: shubh
//Events in JavaScript...
//Event Handling...
node.event = () =>{
  // handle here
};

//Event objects
Node.event = (e) =>{
  console.log(event);
  console.log(event.type);
  console.log(event.target);
}

//Event listeners
node.addEventListener(event,callback)
node.removeEventListener(event,callback)
//note: the callback reference should be same to remove.

Comments