Click in order · JavaScript and React course · Module 10: React Ecosystem and Future

useId Syntax for Accessibility

Arrange the declaration and usage of the useId hook to connect a label with an input:

Items to click

  • <><label htmlFor={id}>Mission code</label>
  • return (
  • );
  • <input id={id} /></>
  • const id = useId();

You can check the correct answer by solving this task in the CodeWorlds game.