HTML HTML Forms Choosing Options Create a Select Menu

Ryan Wikle
Ryan Wikle
3,440 Points

Why does a label tag need to have a "for" attribute?

I don't understand why a <label> tag would not work without a for=" " attribute?

Hi Ryan!

The "for" attribute is for when you click on any label, the input will automatically focus, no need to click on it. But remember "for" has to be the same value as "id" from input.