From the course: Building Great Forms with HTML and CSS
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
New input attributes
From the course: Building Great Forms with HTML and CSS
New input attributes
- [Instructor] In addition to setting the type attribute on an input field, we have a plethora of additional attributes that can make our forms more user friendly. Now we've already discussed the necessity of setting a name attribute. This is used to reference elements in a JavaScript file, or to reference form data after the form has been submitted. As well as the ID attribute, this associates the input with its labels for attribute and can be used with CSS and JavaScript. Remember that each ID needs to be unique per page. In addition to these attributes, we have some other helpful ones. The first one that we're going to be looking at is the value attribute. This is going to specify the initial value for an input field. Setting the value can be problematic, since users may overlook the field thinking it has already been filled out, or it could cause issues with validation. So be careful using this. When you set…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Fieldsets and legends5m 15s
-
(Locked)
Working with labels5m 35s
-
(Locked)
New HTML5 form tags5m 58s
-
New input types6m 23s
-
(Locked)
New input attributes3m 54s
-
(Locked)
More input attributes6m 52s
-
(Locked)
Form validate options4m 56s
-
(Locked)
Input restrictions: Pattern11m 24s
-
(Locked)
Buttons7m 15s
-
(Locked)
Autocomplete3m 30s
-
-
-
-
-
-
-
-
-