3-6编程练习
来源:3-6 编程练习
RoseMe
2018-12-11 16:27:34
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>charCodeAt()</title>
</head>
<body>
<script>
var str="Work hard, earn money."
var strKey=str.indexOf("a");//检测a在字符串中的位置
document.write(strKey+"<br />");//输入a的位置索这值
document.write(str.charCodeAt(strKey)); //获得a的编码
</script>
</body>
</html>
1回答
经测试代码实现的结果没有问题,继续加油!
相似问题