View on GitHub

reads

https://yazansneneh.github.io/reads/

JS Events

EVENT TYPES

How Event Trigger javascript code.

1. Select t he element node(s) you want the script to respond to.
  * select element by tag name (I select array of elements because i might have multi tags of the same kind).
  * select elememnt by class name (also array because i might have the same class on multi elements).
  * select element by class name ( i have one id only for each element).
  * query selector select 1 element.
  * query selector all (select array) 
2. attach event to selected element.
3. write scripts will run when event triggered.

Three ways to bind (add) events to element.

  1. inline - i give element event as attribute and give it function to trigger (value), it uses key pair value.
  2. using dom (e.g. element.event(function)).
  3. add event listener.

THE EVENT OBJECT

EVENT DELEGATION

more on delegation

Forms

Form Controls

how form work ?

  1. user fill required data.
  2. click on submit, then data travel to server for further process.
  3. The name of each form control is sent to the server along with the value the user enters or selects.
  4. The server processes the information using a programming language such ass node.js or php.
  5. server generate respond.
  6. send feedback to user.