Write a JavaScript program to convert the given character to unicode and vice versa.
<html>
<head>
<title>Convert the Given Character to Unicode and vice versa</title>
<script>
function convert()
{
var c = document.getElementById("input1");
var u = document.getElementById("input2");
if(c.value != "")
{
u.value = c.value.charCodeAt();
}
else
{
c.value = String.fromCharCode(u.value);
}
}
</script>
</head>
<body>
<p>Enter either Character or Unicode and click on CONVERT</p>
Character <input type="text" id="input1"/><br/>
Unicode <input type="text" id="input2"/><br/>
<input type="button" value="CONVERT" onclick="convert()"/>
</body>
</html>
