The read only type
property returns the type string of a keygen field.
The type property is supported in all major browsers, except Internet Explorer.
type |
Yes | Yes | Yes | Yes | Yes |
keygenObject.type
A String type value representing the type string of the keygen field.
The following code shows how to get the type of the keygen field.
<!DOCTYPE html>
<html>
<body>
Encryption: <keygen id="myKeygen" name="security">
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<!-- w ww.j av a 2s. co m-->
<script>
function myFunction() {
var x = document.getElementById("myKeygen").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
The code above is rendered as follows: