HTML <keygen> form Attribute
The HTML <keygen> form attribute is used to specify one or more forms that the <keygen> element belongs to.
Syntax:
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
<keygen form="form_id">
Attribute Values: It contains single value form_id which specifies the one or more than one form that Keygen elements belong to. The value of this attribute should be id of the <form> element. Example Code: Below code illustrates the HTML <keygen>form attribute.
HTML
<!DOCTYPE html><html><body> <h1 style="color:green;"> GeeksforGeeks </h1> <h2>HTML Keygen form attribute</h2> <form id = "myGeeks"> Username: <input type="text" name="uname"> <br><br> Encryption: <keygen form="myGeeks" name="secure"> <input type="submit"> </form></body></html> |
Output:

Supported Browsers:
- Apple Safari 1.0
- Google Chrome 1.0
- Firefox 1.0
- Opera 1.0


