Your first Web Form. How to Structure A Web Form.
Why are forms so important in web development? Forms are important because they allow web devs the to make elements that the user can interact with and even get user input to do even more things with.
When designing a form, what are some key things to keep in mind when it comes to user experience? Broadly speaking, we want to design forms to be “dummy proof”. Designed in such a way that it’s for the user hard not to get it right. We want the form to have ways built-in data validation, to ensure users input the data we’re looking for. We also want to ensure our syntax is on point.
<label>
: Provides a caption for the user<input>
: The part where users can interact with<textarea>
: A textbox for multi-line user inputs<button>
: Button for the user to “submit” the form<form>
: Denotes a section of a document for user inputHow would you describe events to a non-technical friend? Events are ways the browser “reacts” to an internet surfer’s actions. Like when links change from blue to purple once you’ve clicked on it.
addEventListener()
method, what 2 arguments will you need to provide?type
listener
Describe the event object. Why is the target within the event object useful? It lets us decide which element will trigger the event.