TechEducationClone

Forms and JS Events

Reading

HTML

htmk forms
First web form
How to structure a web form

JS

Intro to Events

Q&A

HTML

  1. Why are forms so important in web development?

    Easy way for users to interact with a website. Useful for collecting data.

  2. When designing a form, what are some key things to keep in mind when it comes to user experience?
    • keep it simple
    • user friendly
    • things are grouped sensibly
    • use right form lable and input for the job
  3. List 5 form elements and explain their importance.
    1. form = container element (like section or p)
    2. legend = header of a section within the form
    3. label = text visually associated with the input and is associated with it, helps with accessability as someone can click on it instead of the box,button etc for the input
    4. input = this creates the interactive area of the web form for the user to fill in.
    5. button = usually this is a submit button. how the user will ‘send’ their completed inputs

JS

  1. How would you describe events to a non-technical friend?

    an event is like listening for the start signal for you to do something.

  2. When using the addEventListener() method, what 2 arguments will you need to provide?

    what is going to invoke the event eg button click, then what is it going to do eg run a function

  3. Describe the event object. Why is the target within the event object useful?

    when you trigger an object you can target just the bits that you want.

  4. What is the difference between event bubbling and event capturing?

    Event capturing means propagation of event is done from ancestor elements to child element in the DOM while event bubbling means propagation is done from child element to ancestor elements in the DOM.

ARIA