I have a box that looks like this 🟩. I am trying to put it into a string like this
var t = "🟩"
but whenever I try to do that, it automatically gets encoded into something that looks like this 🟩
Here is my code:
<div id="green" style="display: none;">🟩</div>
Should Be
<div id="green" style="display: none;">🟩</div>
How do I decode it? (This code is being uploaded to chrome://extensions if that helps. Thats why its changing I think)
>Solution :
Add <meta charset="UTF-8"> to the head tag.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="green">🟩</div>
</body>
</html>
Also why have you set display to none?