HTML <keygen> disabled Attribute
Last Updated :
07 Jun, 2023
The HTML <keygen> disabled attribute is a boolean attribute that indicates whether the <keygen> element is disabled or not. It is used to keep a user from using an input field until some conditions would be applied to it.
Note: We can use JavaScript to change the value of the disabled <keygen> element.
Syntax:
<keygen disabled>
Example: The below code illustrates the disabled attribute.
HTML
<!DOCTYPE html>
<html>
<body>
<center>
<h1 style="color:green;">
GeeksforGeeks
</h1>
<h2>HTML Keygen disabled attribute</h2>
<form>
Username: <input type="text" name="uname">
<br><br>
Password: <input type="text"><br>
Encryption Element Value:
<keygen form="myGeeks" name="secure" disabled>
<br><input type="submit">
</form>
</center>
</body>
</html>
|
Output:

Supported Browsers:
- Google Chrome
- Firefox
- Opera
- Apple Safari
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...