SOURCE

console 命令行工具 X clear

                    
>
console
function clear_value(){
var input=document.getElementsByTagName("input")
var i;
 for (i=0;i<input.length;i++){
     input[i].value=" "
}
}
function sumbit(){
var a=document.getElementById("one").value
var b=a.charCodeAt()
document.getElementById("two").value=b
}
<html>
    <head>
        <title>字符转换ASCII码</title>
    </head>
    <body>
        <img src="https://www.zenitour.com/img/logoIndex.png"
        <hr>
        <h1>字符转换成ASCII码</h1>
        <input type="text"placeholder="请输入任意字符" id="one">
        <button onclick="sumbit()">转换</button><br/>
        <input type="text"placeholder="转换结果" id="two">
        <button onclick="clear_value()">清空</button>