Latest

recent

JavaScript fromCharCode() Method

Definition and Usage

The fromCharCode() takes the specified Unicode values and returns a string.

Syntax

String.fromCharCode(numX,numX,...,numX)

Parameter Description
numX Required. One or more Unicode values


Tips and Notes

Note: This method is a static method of String - it is not used as a method of a String object that you have created. The syntax is always String.fromCharCode() and not myStringObject.fromCharCode().

Example

In this example we will write "HELLO" and "ABC" from Unicode:

<script type="text/javascript">
document.write(String.fromCharCode(72,69,76,76,79));
document.write("<br />");
document.write(String.fromCharCode(65,66,67));
</script>

The output of the code above will be:

HELLO
ABC
JavaScript fromCharCode() Method Reviewed by 1000sourcecodes on 02:09 Rating: 5
Powered by Blogger.