Article: ALT LEFT
Before running the bookmarklet the image is not identified by JAWS and Picture Smart is not able to provide a description, after running the bookmarklet it is. JAWS Picture Smart is able to provide a description.
This bookmarklet modifies the attributes of <img>
elements and elements with role="img"
on a webpage to ensure they are accessible and labeled as decorative images. It performs the following actions:
alt
, aria-hidden
, and role="presentation"
attributes if present.aria-label
attribute to include an incremental value followed by "decorative".alt
, aria-hidden
, or role
attributes are given role="img"
and an aria-label
.Skip Images with Non-empty alt
Attribute:
<img>
element has a non-empty alt
attribute, it is skipped and not treated as decorative.Remove Attributes:
<img>
element or an element with role="img"
has the alt
or aria-hidden
attributes (with empty alt
), they are removed.<img>
element or an element with role="img"
has role="presentation"
, it is changed to role="img"
.Update aria-label
:
aria-label
, it is updated to include an incremental value, the image size description ("very small", "small", "medium", "large"), followed by "decorative".aria-label
, it is set with an incremental value, the image size description, followed by "decorative".Add role="img"
and aria-label
:
<img>
or <svg>
element has no alt
, aria-hidden
, or role
attributes, role="img"
and an aria-label
with an incremental value, the image size description, followed by "decorative" are added.Alert User: