Created
April 9, 2016 02:45
-
-
Save Archigos/f6f3ff1e331f1c704ea3450ece288b5c to your computer and use it in GitHub Desktop.
Display HTML Entities with Javascript
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
<style> | |
html { | |
background-color: #CCCCCC; | |
} | |
#icons { | |
display: flex; | |
flex-wrap: wrap; | |
justify-content: center; | |
} | |
#icons > div { | |
flex-direction: column; | |
display: inline-flex; | |
padding: 20px 15px; | |
align-items: center; | |
border: 1px solid #AAAAAA; | |
} | |
#icons > div > b { | |
color: #FF0000; | |
font-size: 25px; | |
} | |
</style> | |
<div id="icons"> | |
<script> | |
var start = 0, | |
end = 65535; | |
// It's advised to change start and end to be a lot smaller subset. Full set takes about | |
// 5 seconds on my machine, but will vary by hardware and if local/external. | |
for(var i = start; i <= end; i++) { | |
document.write("<div>"); | |
document.write(" &#" + i + ";"); | |
document.write(" <b>&#" + i + ";</b>"); | |
document.write("</div>"); | |
} | |
</script> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment