HTML5 common interface details, html5 general explanation

Source: Internet
Author: User

HTML5 common interface details, html5 general explanation

1. Let's talk about several basic types:DOMString, boolean, long, unsigned long, double,

NaN (Not-a-Number ).

DOMString is actually a string in other commonly used languages. In HTML5, it is used to represent url, Dom content, and so on. Other boolean (boolean), long (long integer), unsigned long (unsigned long integer), and double (floating point number) I don't want to go into detail, so everyone can understand. As for NaN, I think most of the JS old birds know its meaning, that is, in an infinite

Or a non-numeric value.

Undefined and null are not described in the official documents. As for why, I hope you can answer them with experts ~~

2. Collection types include:HTMLCollection, HTMLAllCollection,
HTMLFormControlsCollection, HTMLOptionsCollection, and
HTMLPropertiesCollection.

HTMLCollection is a generic set and a basic interface of the set. It provides three bubutes:
Length, item, namedItem.

Length is the length of the set.
Item (index) can be used to obtain the elements in the set with the index value.
NamedItem (name) can be used to obtain the element with the name of the element.

In fact, you can also directly use collection [index], collection (index) or collection

[Name], collection (name) to get the elements in the set.

HTMLAllCollection is inherited from the HTMLCollection interface and contains the following attributes:

The attributes of length and item are the same as those of HTMLCollection.

What distinguishes namedItem (name) from HTMLCollection is that it may return a set.

Tags (tagname) returns a set with tagname.

You can also directly use collection [index], collection (index) or collection

[Name], collection (name) gets the elements in the set. If the value matches multiple elements,

HTMLAllCollection.

HTMLFormControlsCollection is a collection of form and fieldset elements. Also inherited from

HTMLCollection interface.

All attributes of HTMLCollection are available, and the RadioNodeList interface is added. It inherits from NodeList.

In fact, RadioNodeList is a set of Radiobutton by definition. I'm curious to put such a list

The intention in HTMLFormControlsCollection.

HTMLOptionsCollection is an option set inherited from the HTMLCollection interface, which is generally used

The child element used to manipulate the select tag.

HTMLOptionsCollection has the following attributes: add (option), remove (index), selectedIndex

The add method has two reloads.

Void add (in HTMLElement element, in optional HTMLElement before );
Void add (in HTMLElement element, in long before );

The first parameter is required for adding an element, and the following parameters are optional.

Remove (index) deletes an element with an index.

SelectedIndex can be understood.

The above HTML5 general interface details are all the content shared by Alibaba Cloud. I hope to give you a reference and support for the customer's house.

Address: http://www.cnblogs.com/androidshouce/archive/2016/06/12/5576501.html

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.