I'm just starting to learn about Web Content Accessibility and I was reading this document regarding non-text contents.
According to it:
For non-text content that is a control or accepts user input, such as
images used as submit buttons, image maps or complex animations, a
name is provided to describe the purpose of the non-text content so
that the person at least knows what the non-text content is and why it
text by which software can identify a component within Web content to
Note 1: The name may be hidden and only exposed by assistive
technology, whereas a label is presented to all users. In many (but
not all) cases, the label and the name are the same.
Note 2: This is unrelated to the name attribute in HTML.
It depends on the control you are using. Some examples:
Input controls, textarea:
label element with the
for attribute, matching the
id attribute of the element.
<label for="input1">My label</label><input type="text" id="input1" />
If you use the
button element include the description inside the content
input[type=submit], you can use the
<input type="submit" value="My label" />
If you want to describe an image, use the
<img src="..." alt="My label" />