html - What should I put in the for attribute of the label tag -


what should put in for attribute of label tag?

i thought should id of element want bind label seems many people uses name instead.

who's right?

according mdn should use id:

the id of labelable form-related element in same document label element. first such element in document id matching value of attribute labeled control label element.

source https://developer.mozilla.org/en-us/docs/web/html/element/label


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -