HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

HTML Tutorial - The 'for' attribute on labels and input fields

33,626 views October 25, 2018 2:30

Watch on YouTube
Channeldcode

Description from the creator

A quick video today on the 'for' attribute within HTML. We take a look at what it's used for and how exactly you would implement it.

When I first started learning HTML I would always incorrectly use this attribute alongside the 'name' attribute which was clearly incorrect.

Support me on Patreon:
patreon.com/dcode - with enough funding I plan to develop a website of some sort with a new developer experience!

For your reference, check this out:
w3schools.com/tags/att_for.asp

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

About this tutorial

dcode published this 2:30 video tutorial on October 25, 2018. It has been watched 33,626 times on YouTube.

Channel
dcode
Category
Education
Duration
2:30
Published
October 25, 2018
Views
33,626
Likes
782

Share

Further reading

  • HTML Required Attribute in Select, Input, and Textarea tutorialdeep.com

    The HTML required attribute can be used to specify whether the element must be filled out or not before submitting the form. It is a boolean attribute that requires boolean values like true and false. Example: Form with…

  • HTML Input Attributes - W3Schools Online Web Tutorials w3schools.com

    The step Attribute. The input step attribute specifies the legal number intervals for an input field.. Example: if step="3", legal numbers could be -3, 0, 3, 6, etc. Tip: This attribute can be used together with the max…

  • HTML label tag - W3Schools Online Web Tutorials w3schools.com

    Tips and Notes. Tip: The for attribute of <label> must be equal to the id attribute of the related element to bind them together. A label can also be bound to an element by placing the element inside the <label> element.

This tutorial in other languages