HTMLImageElement: alt property - Web APIs | MDN
Value
A string.
Examples
Setting the alt attribute
js
const img = new Image();
img.src = "example.png";
img.alt = "An example picture";
Specifications
| Specification |
|---|
| HTML # dom-img-alt |
HTMLImageElement: alt property - Web APIs | MDN
A string.
js
const img = new Image();
img.src = "example.png";
img.alt = "An example picture";
| Specification |
|---|
| HTML # dom-img-alt |