mardi 14 juin 2016

How to use [role=option] on anchors and buttons

a[role=option]

<div role="listbox">
    <a role="option">orange</a>
    <a role="option">purple</a>
</div>

Error: Bad value option for attribute role on element a.

button[role=option]

<div role="listbox">
    <button role="option">orange</button>
    <button role="option">purple</button>
</div>

Error: Bad value option for attribute role on element button.

span[role=option]

<div role="listbox">
    <span role="option">orange</span>
    <span role="option">purple</span>
</div>

Validates okay with spans. Based on the listbox documentation I'd think that a[role=option] or button[role=option] would be valid but those both give validation errors. They are sensible semantic fallbacks...why aren't they valid?

Aucun commentaire:

Enregistrer un commentaire