javascriptjqueryunicodenumbersletter

Convert Number to Unicode sign


I have to print out the letters from A to Z each for itself. So I tried the following:

for(var i = 65; i < 91; i++) {
     $('#alphabet').append('<div class="letter">' + '%' + i + '</div>');
}

My idea is to use the decimal numbers of the letters (for example: 65 - A) to easily print them via loop. Is this possible or do I have to use an array?

Best regards.


Solution

  • You can use String.fromCharCode to convert a character code to string.