【HTML】PageSpeed Insightsでのアラート修正01(ボタンにユーザー補助機能名が指定されていません)

PageSpeed Insightsでチェックをすると
「ボタンにユーザー補助機能名が指定されていません」
というアラートが出ることがあります。

これはbuttonタグに以下の要素を追加することで解消できます。

<button id="al"></button>
 ↓
<button id="al" aria-label="Name"></button>

ユーザーに知らせる必要のない要素やフォーカスが当たるべきでない要素に、適宜aria-label="Name"の代わりにaria-hidden="true"などを設定しても良いでしょう。

参考:https://dequeuniversity.com/rules/axe/4.4/button-name
https://cam-inc.co.jp/p/techblog/466554823458685993

関連記事

コメントを残す

*