WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Is "label" a valid attribute for the img tag?

for

Number of posts in this thread: 3 (In chronological order)

From: Jim Homme
Date: Thu, Apr 11 2024 1:32PM
Subject: Is "label" a valid attribute for the img tag?
No previous message | Next message →

Hi,
This is about me trying to read the Mozilla documentation correctly. When I look up the img tag, "label" is not listed as an attribute. I'm comparing this to what the JAWS screen reader is howing me about an img tag internally here. I'm doing this because the image seems to be displaying to JAWS as a file name such as "image 1.png". Could this also be some sort of JavaScript thing?

Thanks.

Jim

=========Jim Homme: He, Him, His
Senior Digital Accessibility Consultant
Bender Consulting Services
412-787-8567
https://www.benderconsult.com/
Help end the shame of the stigma of mental health disabilities. https://benderleadership.org/notashamed/

From: Patrick H. Lauke
Date: Thu, Apr 11 2024 4:06PM
Subject: Re: Is "label" a valid attribute for the img tag?
← Previous message | Next message →

On 11/04/2024 20:32, Jim Homme wrote:
> Hi,
> This is about me trying to read the Mozilla documentation correctly. When I look up the img tag, "label" is not listed as an attribute. I'm comparing this to what the JAWS screen reader is howing me about an img tag internally here. I'm doing this because the image seems to be displaying to JAWS as a file name such as "image 1.png". Could this also be some sort of JavaScript thing?

"label" is not a valid HTML attribute for an <img> element, no.

And what JAWS is announcing there sounds to me like it's just reading
out the source/filename of the <img> element in the absence of any
appropriate alt attribute.

Unless I'm misunderstanding your question.

P
--
Patrick H. Lauke

* https://www.splintered.co.uk/
* https://github.com/patrickhlauke
* https://flickr.com/photos/redux/
* https://mastodon.social/@patrick_h_lauke

From: Brian Lovely
Date: Fri, Apr 12 2024 9:28AM
Subject: Re: Is "label" a valid attribute for the img tag?
← Previous message | No next message

Hi Jim,

Label is not a valid HTML attribute, as Patrick stated. The correct way to
"label" an img is with the alt attribute. The Mozilla Developer Network
documentation for img
<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes>lists
the available attributes for the img element.

>
>
> On 11/04/2024 20:32, Jim Homme wrote:
> > Hi,
> > This is about me trying to read the Mozilla documentation correctly.
> When I look up the img tag, "label" is not listed as an attribute. I'm
> comparing this to what the JAWS screen reader is howing me about an img tag
> internally here. I'm doing this because the image seems to be displaying to
> JAWS as a file name such as "image 1.png". Could this also be some sort of
> JavaScript thing?
>
>
>