ASDV-WebDev/Semester 1/Chapter ZIPs/JavaScript/ch04/ex_4_28.html

19 lines
430 B
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Example 4.28</title>
<script>
var str="Kitten";
document.write("for the string: " + str + "<br />");
for (j = 0; j < str.length; j++)
{
document.write("Letter number " + (j+1) + " is " + str.charAt(j) + ". ");
document.write(" The Unicode value is: " + str.charCodeAt(j) + "<br />");
}
</script>
</head>
<body>
</body>
</html>