javascript - Is it possible to convert a font icon back into it's private use code? -
for example, using fontawesome, , have span contains icon:
written in html:
<span class="icon"></span>
though once rendered on page:
<span class="icon"></span>
is there way retrieve special character code f05a
once has been rendered?
i.e.
var code = $('.icon').html(), privateusecode; console.log(code); // ????? privateusecode = '\f05a'; // or similar
much appreciated!
var privateusecode = $('.icon').text().charcodeat(0);
hopefully html represented, because whitespace screws up
Comments
Post a Comment