In bootstrap, what is the role of form attribute role = "form ?, Bootstraprole
In essence, the role in html enhances semantics. When the existing HTML tags cannot fully express semantics, they can be explained by role. This usually occurs on some custom components, which can enhance the accessibility, availability and interactivity of the components.
Role is used to describe the actual function of a non-standard tag. For example, if the div is used as the button, set the div's role = "button", and the auxiliary tool can recognize that this is actually a button.
For example,
<Div role = "checkbox" aria-checked = "checked"> </div>
The Helper tool will know that this div is actually a checkbox role and is selected.
Role is an attribute set for students with reading disabilities. The reading screen software can be used to resolve the issue. It has little to do with normal people. If you do not set it, the screen reading software cannot be parsed. If you do not set it, the reading software cannot be parsed.
Since it is a good programming habit, is it better to write all labels into role?
For example
<Div role = "div"> </div>
Normal text can be read, but sometimes there is no password prompt in the input password box in the form, prompting people to use Placeholder to write in the box. Normal people will know how to enter the password here, however, if you cannot read it, it will take effect.
The existence of the attribute role is used to tell an Accessibility application (for example, a screen reading program, a convenience program for the blind to access the network). This is a button. In html5 elements, labels themselves have semantics, so role does not need to be added. At least it is not recommended. However, many bootstrap cases have similar attributes and declarations, the purpose is to be compatible with older browsers (user agents). If your code uses html5 labels and does not support older browsers, you may not use the role label.