Set <aria-hidden=”true”> attribute

for fontawesome icons with JavaScript

Hyouk Seo
spemer
1 min readJan 18, 2018

--

Just copy and paste following code snippet — will set attribute aria-hidden="true" for every <i> tag, if it has classname .fa in your HTML code. (Only if it doesn’t have any aria-hidden attribute itself)

from fontawesome.io; (Note: to improve web accessibility, we recommend using aria-hidden=“true” to hide icons used purely for decoration.)

--

--