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.
More input attributes
From the course: Building Great Forms with HTML and CSS
More input attributes
- [Instructor] As of HTML5, we have some additional attributes that were added to the spec. Let's look at some of those. The first one that we're going to be looking at is autofocus. The autofocus attribute is going to specify that the input field should automatically get focus when the page loads. Autofocus is a Boolean, which means if it's present, it is going to be turned on or working. And if it isn't present, that feature is not going to be functioning in the same way. You can only use autofocus on one element per page. In addition to highlighting that particular field with the focus styles, the blinking insertion point is already ready for us to enter something into that field. The required attribute probably doesn't need much of an introduction. Like autofocus, it does exactly what you expect it to do. By adding it to a form field, the browser is going to require that the user enter data into that field before…
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
-
-
-
-
-
-
-
-
-