Monday, July 6, 2015

What are the new attributes provided in HTML5 for ?


Following are the new attributes provided in HTML5 for <input>

a.) autofocus:
- This is a Boolean attribute.
- When present, it means that an <input> element should automatically get focus when the page is loaded.

b.) form:
- This attribute specifies one or more forms an <input> element belongs to.

c.) formaction:
- This attribute specifies the URL of a file that will process the input control when the form is submitted.
- This attribute is used with type="submit" and type="image".
- It overrides the action attribute of the <form> element.

d.) formenctype:
- This attribute specifies how the form-data should be encoded when submitting it to the server.
- It is used with type="submit" and type="image".
- It overrides the enctype attribute of the <form> element.

e.) formmethod
- It defines the HTTP method for sending form-data to the action URL.
- It is used with type="submit" and type="image".
- It overrides the method attribute of the <form> element.

f.) formnovalidate
- It is a boolean attribute.
- It specifies that the <input> element should not be validated when submitted.
- It is used with type="submit"
- It overrides the novalidate attribute of the <form> element.

g.) formtarget
- It specifies a name or a keyword that indicates where to display the response that is received after submitting the form.
- It is used with type="submit" and type="image".

h.) height and width
- It specifies the height and width of an <input> element.
- It is used only with <input type="image">

i.) list
- It refers to a <datalist> element which contains pre-defined options for an <input> element.

j.) min and max
- It specifies the minimum and maximum value for an <input> element.
- It works with the following input types: number, range, date, datetime, datetime-local, month, time and week.

k.) Multiple
- It is a boolean attribute.
- It specifies that the user is allowed to enter more than one value in the <input> element.
- It works with the following input types: email, and file.

l.) pattern
- It specifies a regular expression that the <input> element's value is checked against.
- It works with the following input types: text, search, url, tel, email, and password.

m.) placeholder
- It specifies a short hint that describes the expected value of an input field.
- It works with the following input types: text, search, url, tel, email, and password.

n.) required
- It is a boolean attribute.
- It specifies that an input field must be filled out before submitting the form.

o.) step
- It specifies the legal number intervals for an <input> element.
- It works with the following input types: number, range, date, datetime, datetime-local, month, time and week.

No comments:

Post a Comment