String.fromCharCode() : fromCharCode : String JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » String » fromCharCode »

 

String.fromCharCode()











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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo String
» fromCharCode