JavaScript fromCharCode() Method
Complete String Object Reference
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:
Try-It-Yourself Demos
fromCharCode()
How to use fromCharCode() to display a string from Unicode values.
Complete String Object Reference
|
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|