Details on newly added HTML5 functions and added html5 Functions

Source: Internet
Author: User

Details on newly added HTML5 functions and added html5 Functions

HTML5 is no longer a subset of SGML. It mainly adds functions such as images, locations, storage, and multitasking.

Painting CANVAS;

The video and audio elements used to play the media;

Local offline storage localstorage stores data for a long time. Data is not lost after the browser is closed; sessionstorage data is automatically deleted after the browser is closed;

Better semantic content elements include: article, footer, header, nav, and section;

Form Control. The type attributes include calendar, date, time, email, URL, and search;

Removed elements include: basefont, big, center, font, s, strike, tt, and u. elements that have negative impact on availability: frame, frameset, noframes;

Support HTML5 new tags: ie8, ie7, and ie6 support document. the tags generated by the createElement method can be used to allow these browsers to support html5 new tags. After the browser supports new tags, you also need to add the default tag style.

The input tag adds many new attributes. Let's list them:

Specify the autofocus attribute for input, select, textarea, And button. It allows the element to automatically obtain the focus after the page is loaded by specifying attributes. Only one element on a page can have the autofocus attribute. If multiple elements are set at the same time, the first element takes effect. When the input box obtains the focus, the character disappears.

This attribute is useful for login pages and can improve user experience. Sometimes the login page has a user name and password. After the page is loaded, the user must manually locate the input box to enter it. With autofocus, open the page and enter it directly.

The max, min, and step attributes are added to datepickers, number, and range of input. The max attribute specifies the maximum value allowed by the input field.

The min attribute specifies the minimum value allowed by the input field.

The step attribute specifies a valid numeric interval for the input field. (If step = "3", the valid number should be-3, 0, 3, 6, and so on.) The step attribute can be used with the max and min attributes, to create a valid value range.

Pattern attributes

The pattern attribute is used to verify the mode of the input field. It is actually a regular expression and does not need to write JavaScript code to bind the regular expression for verification. This is very convenient.

The pattern attribute applies to text, search, url, telephone, email, and password of input.

For example, the input box is defined as "[A-z] {3}", which is A regular expression constraint containing three letters. If the input is invalid, we will see the following results.

Multiple Attributes

The multiple Attribute specifies that multiple values can be selected in the input field.

The multiple Attribute applies to input emails and files. Multiple files can be uploaded at a time.

These are the new html5 labels and functions that I know.

A detailed explanation of the newly added HTML5 function is all the content that I have shared with you. I hope you can give us a reference and support the help house.

Related Article

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.