htmk forms
First web form
How to structure a web form
Easy way for users to interact with a website. Useful for collecting data.
- keep it simple
- user friendly
- things are grouped sensibly
- use right form lable and input for the job
- form = container element (like section or p)
- legend = header of a section within the form
- 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
- input = this creates the interactive area of the web form for the user to fill in.
- button = usually this is a submit button. how the user will ‘send’ their completed inputs
an event is like listening for the start signal for you to do something.
what is going to invoke the event eg button click, then what is it going to do eg run a function
when you trigger an object you can target just the bits that you want.
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.