javascript - font awesome: retrieve css of pseudo element displays a small rectangle -


i trying retrieve css value of font awesome pseudo element. css:

.pe-icon--check:before {     content: '\f00c'; } 

i use query

var symb = window.getcomputedstyle($('.pe-icon--check').get(0), ':before').getpropertyvalue('content'); 

but result small rectangle . value need \f00c. please me fix this?

the below solution worked!!

 var content = window.getcomputedstyle(document.queryselector('.pe-icon--check'),':before').getpropertyvalue('content'); 
function entityforsymbolincontainer(character) {     var code = character.replace(/"/g, '').charcodeat(0);     var codehex = code.tostring(16).touppercase();     while (codehex.length < 4) {         codehex = "0" + codehex;     }     return "\\" + codehex + ";"; } 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -