About input (both the old and new attributes deserve our attention)

Source: Internet
Author: User

Input, commonly used tags, HTML5 before the usual form:

Properties value Description
Accept Mime_type Specifies the type of file submitted through the file.
Alt Text Defines alternate text for image input.
AutoComplete
  • On
  • Off
Specifies whether to use the auto-complete feature of the input field.
Autofocus Autofocus

Specifies whether the input field receives focus when the page is loaded.

(Not applicable for type= "hidden")

Checked Checked Specifies that this input element should be selected when it is first loaded.
Disabled Disabled This element is disabled when the INPUT element is loaded.
Form FormName Specifies one or more forms to which the input field belongs.
FormAction Url

Overrides the form's Action property.

(For type= "submit" and type= "image")

Formenctype See note

Overrides the Enctype property of the form.

(For type= "submit" and type= "image")

FormMethod
  • Get
  • Post

Overrides the form's Method property.

(For type= "submit" and type= "image")

Formnovalidate Formnovalidate

Overrides the Novalidate property of the form.

If this property is used, the form is not validated when it is submitted.

Formtarget
  • _blank
  • _self
  • _parent
  • _top
  • FrameName

Overrides the target property of the form.

(For type= "submit" and type= "image")

Height
  • Pixels
  • %
Defines the height of the input field. (For type= "image")
List Datalist-id Reference the DataList that contains the predefined options for the input field.
Max
  • Number
  • Date

Specifies the maximum value for the input field.

Use with the Min property to create a range of legal values.

MaxLength Number Specifies the maximum length of characters in the input field.
Min
  • Number
  • Date

Specifies the minimum value for the input field.

Use with the Max property to create a range of legal values.

Multiple Multiple If you use this property, more than one value is allowed.
Name Field_name Defines the name of the INPUT element.
Pattern Regexp_pattern

A pattern or format that specifies the value of the input field.

For example pattern= "[0-9]" indicates that the input value must be a number between 0 and 9.

Placeholder Text Provides tips for helping users fill in input fields.
ReadOnly ReadOnly Specifies that the input field is read-only.
Required Required Indicates that the value of the input field is required.
Size Number_of_char Defines the width of the input field.
Src Url Defines the URL of an image to display as a Submit button.
Step Number Specifies the legal number interval for the input word.
Type
  • button
  • CheckBox
  • File
  • Hidden
  • Image
  • Password
  • Radio
  • Reset
  • Submit
  • Text
Specifies the type of the INPUT element.
Value Value Specifies the value of the INPUT element.
Width
  • Pixels
  • %
Defines the width of the input field. (For type= "image")

About input (both the old and new attributes deserve our attention)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.