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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -