THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML <keygen> form Attribute

❮ HTML <keygen> tag

Example

A <keygen> element located outside the form (but still a part of the form):

<form action="/action_page.php" method="get" id="secureform">
  Username: <input type="text" name="usr_name">
  <input type="submit">
</form>

Encryption: <keygen name="security" form="secureform">
Try it Yourself »

Definition and Usage

The form attribute specifies the form the <keygen> belongs to.

The value of this attribute must be equal to the id attribute of a <form> element in the same document. 


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute
form Yes Not supported Yes 6.0 Yes

Syntax

<keygen form="form_id">

Attribute Values

Value Description
form_id Specifies the form element the <keygen> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document.

❮ HTML <keygen> tag