Skip to content
Related Articles

Related Articles

Improve Article

HTML <keygen> form Attribute

  • Difficulty Level : Basic
  • Last Updated : 15 May, 2021

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. 

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
  • Internet Explorer 6

 

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :