Basic JavaScript Learning (13)

Source: Internet
Author: User

JavaScript's Document Object

Learning Essentials:

Document Object

Application of Document objects

I. Document Object

The Document object is an object that represents an HTML file that is displayed in a browser window or frame. JavaScript automatically creates a Document object for each HTML document. The Document object allows you to manipulate the content and other objects in the HTML document.

Child object of the Document object:

Anchor object, Applet object, cookie object, Embed object, form object, Image object, link object, Location object, plugin object.

Second, the application of the Document object

1. Set the color of hyperlinks

Document.linkcolor: Color of hyperlinks that have not been visited

Document.vlinkcolor: The color of hyperlinks that have been visited

Document.alinkcolor: The color of the hyperlinks being accessed

2. Set page background color and default text color

In the BODY element in HTML, you can set the page background color and default text color through the bgcolor property and the Text property.

The bgcolor property and the Fgcolor property of the Document object can also set the page background color and the default text color.

After you set the bgcolor property and the Text property in the BODY element, the HTML itself cannot modify these property values. However, it can be modified by the bgcolor property and the Fgcolor property of the Document object.

3. Image Object

The return value of the images property of the Document object is an array, and each element in the array is an image object.

Basic JavaScript Learning (13)

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.