This tutorial focuses on:
- What is the DOM?
- DOM objects
What is the DOM?
There are several DOM objects by which data can be accessed and manipulated.
window - The window object is at the top of the DOM hierarchy and represents the entire browser window.
- window object properties:
- location - Returns the current URL
- window object methods:
- alert() - Displays some text in an alert box
- prompt() - Displays a prompt box that asks the user for some input
document - Represents an entire webpage and can be used to access the elements on it.
- document object properties:
- domain - Returns the domain in which a webpage is located
- lastModified - Returns the date and time a webpage was last modified
- document object methods:
- write() - Writes text or content specified with HTML tags to a webpage
navigator - The navigator object represents the web browser in use and returns information about it
- navigator object properties:
- appName - Returns the name of the web browser.
- cookieEnabled - Returns a boolean (true/false) value indicating whether cookies are enabled in the web browser or not.
- navigator object methods:
- javaEnabled() - Returns a boolean (true/false) value indicating whether the web browser has Java enabled or not.