1
<form action="demo_keygen.php" method="get">
2
用户名: <input type="text" name="usr_name"> 加密: <keygen id="myKeygen" name="security" keytype="rsa">
3
<input type="submit">
4
</form>
5
<p>点击 "点我" 按钮返回 keygen 字段的keytype属性值。</p>
6
<p id="demo"></p>
7
<button onclick="myFunction()">点我</button>
8
<script>
9
function myFunction() {
10
var x = document.getElementById("myKeygen").keytype;
11
document.getElementById("demo").innerHTML = x;
12
}
13
</script>