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">&#xf05a;</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

http://jsfiddle.net/hyprf/


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -