Weilory
Weilory

Reputation: 3121

convert css unicode to js

I have a couple of emoji unicodes that works well in css:

    content: "\f410"
    content: "\f2d1"

I tries to output it with javascript, but I failed, I will be so grateful for any suggestion you may offer.

console.log('\f410');
console.log('\Uf410');

Upvotes: 0

Views: 83

Answers (1)

shawn
shawn

Reputation: 4363

It should be console.log('\uf410');, lower case u.

ps: and maybe you also like something like: console.log(String.fromCharCode(parseInt('f410',16))).

Upvotes: 1

Related Questions