Current section: Unique IDs 29 exercises
Problem

useId

Loading exercise

Transcript

00:00 All right, so Kelly, the coworker, was refactoring things and decided she didn't want to have to worry about IDs for everything. So we've got now a really cool component that can handle all of our fields and everything in here. But there's no IDs associating the labels to the inputs. And so if you click on these labels,

00:18 with the exception of this one, because it's special. But if you click on these labels, they're not focusing on the input like they should. And so we know that they're not associating the label with that input. If we inspect this input, take a look at the accessibility tab here, you'll see that there's no label for this particular input.

00:37 That's not good for accessibility. It's not good for user experience at all. So your job is to associate those properly, but to do so using use ID. So have a good time.