Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML DOM Keygen type Property

Improve Article
Save Article
  • Last Updated : 28 Sep, 2022
Improve Article
Save Article

The HTML DOM Keygen type property is used to return the type of form element containing the Keygen field. This property will always return “keygen”.


Return the keygen type property.


Return Values: It returns a string value that represents the type of form element’s keygen field. 

Example: Below program illustrates the use of keygen type property.  


<!DOCTYPE html>
        h2 {
            color: green;
        body {
            text-align: center;
    <p><b>HTML DOM Keygen type Property</b></p>
    <form id="formID">
        <input type="text" name="uname">
        <br><br> Encryption:
        <keygen id="keyid" form="formID"
            name="secure" autofocus>
        <input type="submit">
    <button onclick="My_form()">
    <p id="test"></p>
        function My_form() {
            var d = document.getElementById("keyid").type;
            document.getElementById("test").innerHTML = d;


 Supported Browsers:

  • Google Chrome
  • Internet Explorer Not supported
  • Opera
  • Firefox
  • Apple Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!