String fromCharCode() Method - Javascript String

Javascript examples for String:fromCharCode

Description

The fromCharCode() method converts Unicode values into characters.

Parameter Values

Parameter Description
n1, n2, ..., nX Required. One or more Unicode values to be converted

Return Value:

A String, representing the character(s) representing the specified unicode number(s)

The following code shows how to Convert a Unicode number into a character:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from w  w w .  j  a va 2s  .c  om
    var res = String.fromCharCode(72, 69, 76, 76, 79);
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>

Related Tutorials