Open In App

HTML <keygen> form Attribute

The HTML <keygen> form attribute is used to specify one or more forms that the <keygen> element belongs to.

Syntax:



<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. 




<!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:

 

Article Tags :