Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML DOM Keygen disabled Property

  • Last Updated : 05 Oct, 2021

The HTML DOM Keygen disabled property is used to set or return a boolean value that indicates whether a Keygen element should be disabled or not.  A disabled keygen field is unusable. This property is used to reflect the HTML disabled attribute. 


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

Return the disabled property.


Set the disabled property:

KeygenObject.disabled = true|false


Property Value:

  • true|false: It is used to specify whether a keygen field should be disabled or not.

Return Values: It returns a Boolean value that represents the keygen field that is disabled or not. 

Example: Below code demonstrates how to enable and disable the keygen field.  


        HTML DOM Keygen disabled Property
<body style="text-align: center;">
    <h1 style="color: green;">
    <h2>HTML DOM Keygen disabled Property</h2>
    <form id="myform">
        Username: <input type="text" name="uname">
        <keygen id="keygenID" form="myform" 
            name="secure" disabled>
        <input type="submit">
        Click on Below Buttons to set 
        the Keygen disabled Property
    <button onclick="click1()">Set</button>
    <p id="test"></p>
        function click1() {
            var g = document.getElementById(
                    "keygenID").disabled = true;
            alert("Now the value of the disabled"
                + " property is set to " + g);


Supported Browsers: 

  • Google Chrome
  • Firefox
  • Apple Safari
  • Opera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!