I'm trying to dynamically set a FontAwesome glyph inside a span or a button through the CSS property attr(property).
What I would like to have is to set an attribute on the tag
<button glyph="\f005"></button>
and then use it in the CSS file like this
button::before{
content: attr(glyph)
}
But it looks like it doesn't work and it just display the code I've written in the tag. Is there a way to "render" the code or to make the CSS consider it as an escaped character?
Take a look at this Fiddle for a quick example.