Reading Journal
This topic is important because forms are something we interact with everyday. Forms are used when providing feedback, placing online orders, or inputting data to be gathered and used to elsewhere. Knowing how to create a form is a skill that can be used in everyday web development.
- Forms are crucial to web development because this is how users are able to interact with the page itself. From collecting data on the back end to placing an order on a retail site, forms are valuable vessels to enable interaction with users.
- Some things to keep in mind when designing a form is to keep things clear and simple, keep the form length to a minimum and ensure that the layout is logical and appropriate. When users input an invalid data set, make sure they get clear feedback in a way that is easily recognizable and when possible, use autofill features to speed up the process. Always have accessibility in mind when designing the form and test it before releasing it to the public.
- The
<label> element allows you to provide a clear description of the input field. It also aids in the user understanding what information is expected from them. Properly described labels also aid with screen reader functionality.
- The
<input> element is useful in that it allows the developer to change its type attribute in order to specify what type of data is needed and also the method in which it is to be collected by the user.
- The
<textarea> element allows a greater area for users to enter information. These are widely used in surveys or comment sections on forms. This allows more space than just a single line.
- The
<button> element allows direct user interaction with the form through the use of a responsive button that can be used to submit, reset, or be set to perform a custom action.
- The
<form> element is the main container that is used to hold all other form elements. The form element is where forms are organized, structured, and created to achieve the designer’s finished form idea.
Learn JS
Introduction To Events.
1. How would you describe events to a non-technical friend?
- An event is basically an object that when interacted with, sends out a signal to a special type of code that is designed to keep an eye out for the signal and react in a predefined way. An event is another type of cause and effect concept.
2. When using the addEventListener() method, what 2 arguments will you need to provide?
- The first thing we must provide is a string which tells the event listener what to listen for. The second thing that must be provided is what function to execute when the event occurs.
3. Describe the event object. Why is the target within the event object useful?
- The event object is essentially logging a digital input and passing it to the event handler to then decide what to do with it. The target in the event object is useful because it allows us to identify which element caused the event to occur. This is particularly helpful when you have multiple events happening and you need to identify a particular event.
4. What is the difference between event bubbling and event capturing?
- The main difference between the two is how the event is captured. In event bubbling, the event is handled from the target and travels throughout up to the root element, while event capturing intercepts the event before it gets to the target and then works its way down to the target.
Things I want to know more about.
I’d like to know more about CSS and what options it has to customize the various elements within the form tag.