Javascript language

adplus-dvertising
Generate Unicode
Previous Home Next

How to Generate Unicode using JavaScript

Step 1. Written below code in your application.

<html>
<head>
<script language="JavaScript">
function toUnicode()
{
var str=document.myForm.myInput.value
if (str!="")
{
unicode=str.charCodeAt(0)
}
document.myForm.unicode.value=unicode
}
</script>
</head>
<body>
<form name="myForm">
Enter a character:<br />
<input size="1" name="myInput" maxlength="1" onkeyup="toUnicode()">
<hr />
Unicode character:<br />
<input size="3" name="unicode">
</form>
</html>

Step 2. Run the Application.

Previous Home Next