質問

on an form, can the aria-labelledby attribute work on its own or does it require a label tag?

EXAMPLE: Does it work like this

aria-labelledby="Name"

Read by the browser as "Name"?

役に立ちましたか?

解決

"The aria-labelledby attribute is used to indicate the IDs of the elements that are the labels for the object." (MDN).

It does not contain a text label.

So no, it doesn't work on its own.

It doesn't require a <label> element, but if a <label> is the correct HTML element for the context then you should use one. (Start with correct, semantic HTML, then build ARIA on top of it).

他のヒント

It requires a Label tag and is meant to work in conjunction with an associated input tag. Check out this link for more information: http://www.w3.org/TR/2013/WD-aria-in-html-20130214/#aria-labelledby-and-aria-describedby

Hope this helps!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top