The  Document  Object

The document Object มีความสำคัญมากใน JavaScript เพราะว่ามันยอมให้คุณสามารถ Update เอกสาร HTML ที่ถูก เรียกได้ แล้ว document ก็มี Properties ให้คุณเล่นกับ element ต่างๆ มากพอสมควร

Properties of Document Object
ดูจากตารางละกันนะครับ
PropertyDescription
alinkColorให้ค่าสีของ alink (ก็ใน tag <body> ไง)
anchorAn object that refers to an array contained in a document
anchorsAn array of all the anchors contained in a document
appletเป็น Object ที่หมายถึง applet ใน document
appletsเป็น Array ของ Applet ใน document
areaเป็น Object หมายถึง Image map Area ใน document
bgColorให้ค่าของสีพื้นหลัง
cookieให้ค่า cookies
domainให้ค่า domain name ของ document server
embedsarray ของ plug-in ใน document
fgColorให้ค่าสีตัวอักษรปกติ (text)
formObject ของ form ใน Document
formsเป็น Array ของ form ใน Document
historyเป็น List ของ URL ที่คุณเคยไป ใน window ปัจจุบัน
imageImage Object ใน Document
imagesArray ของ Image
lastModifiedวันที่ Document ถูก Update ครั้งสุดท้าย
linkตัว link ใน document
linksArray ของ links
linkColorสีของ link
plugin plugin ใน document
refererURL ของ document ที่ links มาที่ document นี้
titletitle ของ document
URLURL ของ Document
vlinkColorสีของ vlinks
แฮก แฮก เยอะจัง แต่บางตัวคุณไม่ต้องรู้จักก็ได้นะ คุณใช้ไม่หมดหรอก ในบทนี้ผมจะสอนตัวสำคัญบางตัวก่อน แล้วที่เป็น Object คุณก็ไปอ่านในบทต่อๆไปนะครับ

ตัวอย่างนี้เป็นการแสดง Properties ของ window หน้านี้ครับ