HTML5 form elements

HTML5 has new form elements that previous versions of HTML did not feature.They are

  • <datalist></datalist>
  • <keygen></keygen>
  • <output></output>

<datalist> Element

The <datalist> element in HTML5 specify the options that can be included for an input field . This <datalist> element  will specify the list of options for an input field.

The <datalist> element specifies a list of options for an input field.<option> tag can be used to insert/create elements within the <datalist> tag.In order to bind a<datalist> element to an input field refer the list attribute of the input field to the data list id.

 

<keygen> Element

This element <keygen> can be used to provide a secure authentication way to the users. This  >keygen> element is used to generate a key-pair. Once the form is submitted this <keygen> element generates two keys of which one is a public key and another one is a private key.

Thus generated private key is stored on the client machine while the public key generated is sent to the server. To generate a client certificate and to provide authentication to the user in the future this public key will be used. But currently only latest browser versions support this and many others do not.

 

<output> Element:

In order to provide users with a more clear and distinctive presentation like outputs of calculation or a script, this element can be used.