A brief description of JavaScript's support to traditional Document object Model-Basic knowledge

Source: Internet
Author: User

This is the model that was introduced in earlier versions of the JavaScript language. Everyone is supported by all browsers, but only allows access to certain key parts of the file, such as forms, form elements, and images.

The model provides several read-only properties, such as headers, URLs, and last changes that provide information about the overall document. There are various methods in addition to the property values that the model can use to set and get documents.
document properties in the traditional DOM:

The following is a document property that can be accessed using the traditional DOM access list:

Document methods in the traditional DOM:

Here is a list of methods supported by the traditional DOM:

Example:

We can find any HTML element that uses HTML DOM for any HTML document. For example, if a Web page file contains a FORM element and then uses JavaScript, we can call it document.forms[0]. If the Web document includes two form elements, the first form is called Document.forms[0] and the second is document.forms[1].

Using the hierarchical structure and properties given above, you can use Document.forms[0].elements[0].

Here is an example of accessing document properties using traditional DOM methods:

 
 

Note: The form and content of this example return objects, and we will have to access their values using properties that are not discussed in this tutorial.

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.