Skip to content

Latest commit

 

History

History
9 lines (9 loc) · 597 Bytes

File metadata and controls

9 lines (9 loc) · 597 Bytes

Forms and JS Events

Js Events

everything that happens in a website or in the browser is an event. clinking on links,hovering and pretty much anything is an event. events are the browser's way to tell us that something has happened.
event trigger code. if you click on a button(event) some code in the js file is called (triggered).
we do this because we want the page to feel more interactive and alive.
there are 3 main ways to bind an event:

  • HTML event handlers (bad practice)
  • traditional DOM event handlers(better has limitations)
  • DOM level 2 event listeners (best one of 3)