Why use

前端 未结 8 1998
时光说笑
时光说笑 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:30

    HTML tags are meant to convey special meaning to users of various categories. Here is what label is meant for:

    1. For people with motor disabilities (also for general mouse users) Correctly used label tags can be clicked to access the associated form control. Eg. Instead of particularly clicking the checkbox, user can click on more easily clickable label and toggle the checkbox.

    2. For visually-challenged users Visually challenged users use screen-readers that reads the associated label tag whenever a form control is focused. It helps users to know the label which was otherwise invisible to them.

    Read more about labelling here

提交回复
热议问题