Javascript Reference - HTML DOM Keygen type Property








The read only type property returns the type string of a keygen field.

Browser Support

The type property is supported in all major browsers, except Internet Explorer.

type Yes Yes Yes Yes Yes

Syntax

keygenObject.type

Return Value

A String type value representing the type string of the keygen field.





Example

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: