Home  >  Article  >  Web Front-end  >  The role of role in html

The role of role in html

高洛峰
高洛峰Original
2016-11-21 13:25:112423browse

role is to enhance semantics. When existing HTML tags cannot fully express semantics, you can use role to explain.

Usually this happens with some customized components, which can enhance the accessibility, usability and interactivity of the components.

role is used to describe the actual function of a non-standard tag. For example, if you use a div as a button, then set the role="button" of the div, and the auxiliary tool can recognize that it is actually a button


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn