[ADDED IN VERSION 5.0.1] For screen reader support: Sets the aria-label attribute of the icon within the provided element. Screen readers will then read the label when moused over.
<div data-icon="home"><svg>...</svg></div> setIconAriaLabel(myDiv, 'Home button'); The div becomes <div data-icon="home"><svg aria-label='Home button'>...</svg></div> Copy
<div data-icon="home"><svg>...</svg></div> setIconAriaLabel(myDiv, 'Home button'); The div becomes <div data-icon="home"><svg aria-label='Home button'>...</svg></div>
setIconAriaLabel
The div which contains the icon.
The label for screen readers to read when moused over.
[ADDED IN VERSION 5.0.1]
For screen reader support: Sets the aria-label attribute of the icon within the provided element. Screen readers will then read the label when moused over.
Example
Method
setIconAriaLabel