String.fromCharCode() : fromCharCode « String « JavaScript Tutorial






Syntax

String.fromCharCode(num1, num2,..,numN)
    String.fromCharCode(keyevent.which)

The fromCharCode() method returns the characters that correspond to the ISO-Latin-1 numbers (num1, num2, ..., numN) position passed.

You can also pass the method a key event and use the which property to determine which key has been pressed. The possible key events are KeyDown, KeyPress, and KeyUp.

This is a method of the actual String object and not an instance of this object.

<html>
    <script language="JavaScript1.2">
    <!--

    var myString = String.fromCharCode(88,89,90);
    document.write("These numbers evaluate to: " + myString);
    document.close();
    -->
    </script>
</html>








6.15.fromCharCode
6.15.1.String.fromCharCode()