<html> <head> <script type="text/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"> Write a character:<br /> <input size="1" name="myInput" maxlength="1" onkeyup="toUnicode()"> <hr /> The character's Unicode:<br /> <input size="3" name="unicode"> </form> </html>
Edit the text above, and click on the button to see the result.
Copyright © 2007-2008, Www.JavaBasics.We.Bs All rights reserved.