Why use

前端 未结 8 1996
时光说笑
时光说笑 2020-12-13 23:58

From a presentation perspective, if I write a text between a tag it looks identical as to if I hadn\'t.

So, why do we use this tag at all?

8条回答
  •  温柔的废话
    2020-12-14 00:36

    The for attribute of a label element corresponds to the id attribute of an input element. If you click the label, it puts focus on the input box.

    Example:

     
    
    

    See this in action.

    If you click on the text, it checks the box.

提交回复
热议问题