<html>
<body>
<form action="demo_keygen.php" method="get">
Username: <input type="text" name="usr_name">
Encryption: <keygen id="myKeygen" name="security">
<input type="submit">
</keygen></form><br>
<button onclick="disableKey()">禁用 Keygen 字段</button>
<button onclick="undisableKey()">启用 Keygen 字段</button>
<script>
function disableKey()
{
document.getElementById("myKeygen").disabled=true;
}
function undisableKey()
{
document.getElementById("myKeygen").disabled=false;
}
</script>
</body>
</html>