js关于字母与ASCII码数字之间的转换

来源:互联网 发布:网络神作小说 知乎 编辑:程序博客网 时间:2024/05/22 03:41
<script type="text/javascript">function test(){// 数字转换位字符var code = String.fromCharCode(97);// 字符转换为数字    var s="a"; alert(code);    alert(s.charCodeAt(0));}test();</script>

原创粉丝点击