Skip to content

Instantly share code, notes, and snippets.

@Archigos
Created April 9, 2016 02:45
Show Gist options
  • Save Archigos/f6f3ff1e331f1c704ea3450ece288b5c to your computer and use it in GitHub Desktop.
Save Archigos/f6f3ff1e331f1c704ea3450ece288b5c to your computer and use it in GitHub Desktop.
Display HTML Entities with Javascript
<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(" &amp;#" + 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