Unicode of a character

July 31, 2007

In Javascript, there’s a very handy function charCodeAt() that returns the Unicode of a character. For example:

<script type=”text/javascript”>
var str=”Hello world!”;
document.write(str.charCodeAt(1));
</script>

Source of info:  http://www.w3schools.com/jsref/jsref_charCodeAt.asp