如何修复此灯塔错误:
Buttons do not have an accessible name
<button class="search-button" type="submit" value="Search"></button>
我是初学者。
最佳答案
我会推荐这个链接以供引用。
https://developers.google.com/web/tools/lighthouse/audits/button-name
它建议按钮应具有内部文本内容或 aria-label 或 aria-labelledBy。
<button class="search-button" type="submit">Search</button>
<button class="search-button" type="submit" aria-label="search"></button>
我展示了一个带有内部文本的按钮以及一个带有 aria-label 的按钮。
关于html - 灯塔错误 : "Buttons do not have an accessible name",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56082381/