The document object
-
Upload
saw-zin-min-tun -
Category
Design
-
view
45 -
download
1
Transcript of The document object
![Page 1: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/1.jpg)
The Document Object
Presentation by Saw Zin Min Tun
![Page 2: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/2.jpg)
The Document Object
• Defining the Document Object• Using the Properties of the Document Object• Using the Methods of the Document Object
![Page 3: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/3.jpg)
Defining the Document Object
• The document object is an object that is created by the browser of each new HTML page(document) that is viewed.
• By doing this, JavaScript gives you access to a number of properties and methods that can affect the document in various ways.
• You have been using the write() method of the document object.
![Page 4: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/4.jpg)
Using the Properties of the Document Object• alinkColor• Anchors• bgColor• dir• fgColor• formName• linkColor
![Page 5: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/5.jpg)
Using the Properties of the Document Object
• URL• vlinkColor
![Page 6: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/6.jpg)
Using the Properties of the Document Object
• alinkColor The alinkColor property holds the value of the active link
color(the color of a link when it is clicked) for the HTML document.
Returns the hexadecimal value of the active link color of the document.
![Page 7: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/7.jpg)
Using the Properties of the Document Object
• Anchors The anchors property is actually an array that is set by the
browser for all the named anchors in a document (such as <A NAME=“top”>).
An array of all the named anchors in the document.
![Page 8: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/8.jpg)
Using the Properties of the Document Object
• bgColor The bgColor property holds the value of the background
color of a Web page. Returns the hexadecimal value of the background color of
the document. Eg: document.bgColor = “lightblue”;
![Page 9: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/9.jpg)
Using the Properties of the Document Object
• dirThe dir property returns a string value that represents the
readin direction of the document.This value can be either ltr(left to right) or rtl(right to left).Eg: document.dir = “rtl/ltr”;
![Page 10: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/10.jpg)
Using the Properties of the Document Object
• fgColor The fgColor property is the equivalent of the regular text color on a
Web page. The “fg” in this property stands for foreground. Returns the hexadecimal value of the default text color of the
document. Eg: document.fbColor
![Page 11: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/11.jpg)
Using the Properties of the Document Object
• formName The formName property isn’t actually a property itself. Any time you name a form, you create a formName property, but
the property is actually the name of the form and not formName.
![Page 12: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/12.jpg)
Using the Properties of the Document Object
• linkColor The linkColor property holds the value of the link color of the
document. Returns the hexadecimal value of the default link color for the
document Eg: document.linkColor = “#0000FF”;
![Page 13: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/13.jpg)
Using the Properties of the Document Object
•URL The URL property holds the value of the full URL of the current
document. This information can be useful if you print it at the bottom of
your HTML page, because it will show the page URL for anyone who prints out your page.
Returns the URL of the current document
![Page 14: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/14.jpg)
Using the Properties of the Document Object
• vlinkColor The vlinkColor property holds the RGB code for the visited link
color on a Web page. Returns the hexadecimal value of the visited link color for the
document. Eg: document.vlinkColor = “#0000FF”;
![Page 15: The document object](https://reader035.fdocuments.in/reader035/viewer/2022062503/58a18a441a28abca5a8b67dd/html5/thumbnails/15.jpg)
Thank you!