Last active
December 11, 2023 15:00
-
-
Save 03c/bb3b2b6dc1a8b21ba9be1b302055cce0 to your computer and use it in GitHub Desktop.
Code Point to Char
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Font Demo</title> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght@400&text=person" /> | |
</head> | |
<body> | |
<span class="material-symbols-outlined"> | |
person | |
</span> | |
<span class="material-symbols-outlined"> | |
| |
</span> | |
<h1>From code point</h1> | |
<input type="text" id="codepointInput" placeholder="e.g., e8b6 for search"> | |
<button id="convertButton">Convert</button> | |
<p></p> | |
<span id="outputSpan" class="material-symbols-outlined"></span> | |
<script> | |
document.getElementById('convertButton').addEventListener('click', function() { | |
let codepoint = document.getElementById('codepointInput').value; | |
let char = String.fromCharCode(parseInt(codepoint, 16)); | |
document.getElementById('outputSpan').textContent = char; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment