SOURCE

console 命令行工具 X clear

                    
>
console
// 加密
function encode()
{  

  var str = secret.value;
  var r = "";
  // string 类型的可以当做字符串对象来用
  for (var i = 0; i < str.length; i++)
  {
    // 取出下标为 i 字符的编码
    var code = str.charCodeAt(i);
    
    // 将字符对应的编码,拼接到一个空字符串上
    r += code;
    // 每个符号后,添加 , 分割
    r += ",";
  }
  // secret.value 
  // 设置输入框的内容为 r
  secret.value = r;
}

<body>
      <div class="top" style="height:70px;border-bottom:1px solid #ddd;">
<img class="logoIndex" height="60" src="https://www.zenitour.com/img/logoIndex.png" style="margin-left:10px;margin-top:5px;">
</div>
   <div class="content" style="text-align:center;margin-top:50px;height: 78%;">
 <h1> 加密 </h1>
 <input type="text" id="secret" /> 
 <input type="button" value="加密" onclick="encode()">
  </div>
      <div id="bottom" style="text-align:center;border-top:1px solid #ddd;">
<span class="centerspan" style="font-size:10px">Copyright © 2017 Zenitour lnc All Rights Reserved 版权所有-哲途教育  渝ICP备13002955号-2</span>
  </div>
</body>
         html,body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }