I have about 250 font icons on a page and I would like to programmatically extract the Unicode values for each icon.
A typical icon has corresponding CSS like this:
.icon-play:before {
content: "\f04b";
}
What I've tried so far...
document.querySelectorAll('[class^=icon-]')
to access the icons (call each one i
for now). i.style
to try to access the style object. The problem is that the i.style.content
value is empty.
I've also tried to access the content this way document.querySelectorAll('[class^=icon-]:before')
but this produces an empty result.
Any help is appreciated. Thanks.