Document-object properties and Common object methods

Source: Internet
Author: User

Document-object properties and Common object methods

Object Properties

Document.title//Set document title equivalent to the title tag of HTML

Document.bgcolor//Set page background color

Document.fgcolor//Set foreground (text color)

Document.linkcolor//non-clicked link color

Document.alinkcolor//Activate link (focus on this link) color

Document.vlinkcolor//Clicked link color

Document. URL//Set URL property to open another page in the same window

Document.filecreateddate//File creation date, read-only property

Document.filemodifieddate//File modification date, read-only property

Document.filesize//File size, read-only property

Document.cookie//Set up and read out cookies

Document.charset//Set character sets Simplified Chinese: gb2312

———————————————————————

Common Object Methods

document.write ()//write content to page dynamically

Document.createelement (tag)//Create an HTML tag object

document.getElementById (ID)//Get the object with the specified ID value

Document.getelementsbyname (name)//Gets the object with the specified Name value

Document.getelementsbyclassname ("ClassName")//Gets the object (array) of the specified class value

document.getElementsByTagName ("TagName")//Get the specified Tag object

Document.body.appendChild (Otag)

———————————————————————

Document-object properties and Common object methods

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.