简体   繁体   English

aria-expanded 和 aria-haspopup 属性是否适用于<select />元素?

[英]Does the aria-expanded and aria-haspopup attributes apply to <select /> elements?

From the W3C wiki来自 W3C 维基

When authors use collapsible content, for example, to hide navigation menus or lists of content, the triggering link or button should indicate to screen reader users whether the collapsable content below is in the expanded or in the collapsed state.例如,当作者使用可折叠内容来隐藏导航菜单或内容列表时,触发链接或按钮应向屏幕阅读器用户指示下方的可折叠内容是处于展开状态还是处于折叠状态。 The aria-expanded attribute is used for this purpose. aria-expanded属性用于此目的。

Does this include <select> elements or is this only for navigation items?这包括<select>元素还是仅用于导航项?

The select element can accept any global aria-* attribute, and any aria attribute applicable to the role listbox. select元素可以接受任何全局aria-*属性,以及适用于角色列表框的任何 aria 属性。

aria-haspopup is allowed for any role, and aria-expanded is allowed for the listbox role. aria-haspopup可用于任何角色,而aria-expanded可用于列表框角色。

Note that, the browser should already define the default implicit semantic so you do not have to care about defining an aria attribute to define the state of the select control if you're using the native element.请注意,浏览器应该已经定义了默认的隐式语义,因此如果您使用本机元素,则不必关心定义aria属性来定义select控件的状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM