HTML5 form attribute types.

Several new attributes has been inserted for the form element of html5. Some attributes are discussed below with examples.

List attribute to be used with data list element, potential value of the list adapted for input. The list attributes that are used for input and data list are used to create a list of options.

Minimum – Maximum
Min and Mex attribute, Established a control of the input value. Minimum input value is determined by Min and Maximum input value is determined by the Max. An example given below where the minimum is 20 and the maximum is 100.

Multiple attributes:
You can display multiple-value of input by this multiple attribute.
The syntax is:

You can see the output like below in browser.
Now click on choose file from any folder or drive in your computer stored and can upload.

The user’s are getting an idea about the nature of input by the placeholder. These are text which contains the input field, by default.

This attribute enables the browser to validate input. To validate the input to ensure that input is compatible with regular expression. By this attributes is determined of which pattern input will be accepted. If the pattern does not match , a warning “please match the requested format” will display. The two names separated by a blank space
and the input is to validate.

Leave a Reply

Your email address will not be published. Required fields are marked *