From the course: JavaScript: Web Form Programming
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Automatic shortcut keys
From the course: JavaScript: Web Form Programming
Automatic shortcut keys
- [Instructor] In the previous example, we saw how to make our forms accessible via the keyboard by using the access key attribute. So in this video, we're going to see how we can automate the process of giving the user a visual indicator that a form field has an access key. So let's resume by looking at our code. So if we scroll up to the top, you will see that I have some JavaScript functions here in the code named add access key hints, and add key hint. And these are the functions that we're going to fill in. So the add access key hints function runs when the window loads. It starts off by getting the form element. And then it iterates over all of the elements of the types that are in this array. So all the labels, all the links and all the buttons. And for each one of those elements, we get a list of all the elements of that type. And then we check to see if each of those elements has an access key attribute, and if it…
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
-
-
-
Label and field interaction8m 11s
-
(Locked)
Implementing shortcut key navigation5m 55s
-
(Locked)
Automatic shortcut keys9m 13s
-
Form and field events8m 55s
-
(Locked)
Using the output element5m 10s
-
(Locked)
The details element in forms3m 47s
-
(Locked)
Challenge: Form programming1m 51s
-
(Locked)
Solution: Form programming5m 18s
-
-
-
-
-