Search This Blog

Thursday, 28 July 2016

How to convert Unicode to character in javascript?

Html page:

<button onclick="myFunction()">Try it</button>
<p id="demo"></p>

Javascript Page:

<script>
function myFunction()
{
    var res = String.fromCharCode(65);
    document.getElementById("demo").innerHTML = res;
}
</script>

Output:

A

No comments:

Post a Comment