Do I need role=“button” on a <button>?

前端 未结 7 703
-上瘾入骨i
-上瘾入骨i 2020-12-15 22:59

I\'ve noticed in all of Bootstrap\'s examples using button elements, they include role=\"button\" (and type=\"button\"), such as:

7条回答
  •  遥遥无期
    2020-12-15 23:14

    The requirements and recommendations are now much more exhaustively documented in "ARIA in HTML"

    The following table provides normative per-element document-conformance requirements for the use of ARIA markup in HTML documents and describes the implicit ARIA semantics that apply to HTML elements as defined in the HTML Accessibility API Mappings 1.0 [html-aam-1.0] specification.

    https://w3c.github.io/html-aria/#document-conformance-requirements-for-use-of-aria-attributes-in-html

提交回复
热议问题