document is an instance of the Document class
Document is an HTMLDocument instance in html, XMLDocument instance in xml, svg. Tag elements such as body are instances of the HTMLBodyElement class and div are HTMLDivElement instances.
Class inheritance system
- All classes inherit from Node. Node inherits from EventTarget. (not shown) Window inherits from EventTarget.
- HTMLElement inherits from Element,Element, inherits from Node.
- Document inherits from Node.
EventTarget
Base class. There are three ways:
- AddEventListener
- RemoveEventListener
- DispatchEvent
Node
extends EventTarget to become a new base class. Commonly used properties and methods:
- ChildNodes
- FirstChild
- LastChild
- nextSibling
- NodeType
- NodeValue
- OwnerDocument
- parentNode
- ParentElement
- PreviousSibling
- TextContent
Document
inherits from Node. Describes the common properties and methods of any type of document. Common attributes and methods:
- Cookie
- Domain
- Location
- title
- URL
Element
inherits from Node. Describes the methods and attributes common to all elements of the same kind. Commonly used properties and methods:
- ClassName
- Id
- InnerHTML
- GetElementsByClassName
- Scroll