Most interfaces in the HTML DOM API map almost one-to-one to individual HTML elements. This interface allows you to perform various actions on your webpage, such as getting, removing, adding, and changing HTML elements. Many options and methods are available to accomplish these changes, and we will cover some of the most common ones in the next section.
The majority of the interfaces that comprise the HTML DOM API map almost one-to-one to individual HTML elements, or to a small group of elements with similar functionality. In addition, the HTML DOM API includes a few interfaces and types to support the HTML element interfaces.
These interfaces represent specific HTML elements (or sets of related elements which have the same properties and methods associated with them).
HTMLAnchorElement
HTMLAreaElement
HTMLAudioElement
HTMLBaseElement
HTMLBodyElement
HTMLBRElement
HTMLButtonElement
HTMLCanvasElement
HTMLDataElement
HTMLDataListElement
HTMLDetailsElement
HTMLDialogElement
HTMLDirectoryElement
HTMLDivElement
HTMLDListElement
HTMLElement
HTMLEmbedElement
HTMLFieldSetElement
HTMLFormElement
HTMLHRElement
HTMLHeadElement
HTMLHeadingElement
HTMLHtmlElement
HTMLIFrameElement
HTMLImageElement
HTMLInputElement
HTMLLabelElement
HTMLLegendElement
HTMLLIElement
HTMLLinkElement
HTMLMapElement
HTMLMediaElement
HTMLMenuElement
HTMLMetaElement
HTMLMeterElement
HTMLModElement
HTMLObjectElement
HTMLOListElement
HTMLOptGroupElement
HTMLOptionElement
HTMLOutputElement
HTMLParagraphElement
HTMLPictureElement
HTMLPreElement
HTMLProgressElement
HTMLQuoteElement
HTMLScriptElement
HTMLSelectElement
HTMLSlotElement
HTMLSourceElement
HTMLSpanElement
HTMLStyleElement
HTMLTableCaptionElement
HTMLTableCellElement
HTMLTableColElement
HTMLTableElement
HTMLTableRowElement
HTMLTableSectionElement
HTMLTemplateElement
HTMLTextAreaElement
HTMLTimeElement
HTMLTitleElement
HTMLTrackElement
HTMLUListElement
HTMLUnknownElement
HTMLVideoElement
HTMLMarqueeElement
Deprecated
HTMLFontElement
Deprecated
HTMLFrameElement
Deprecated
HTMLFrameSetElement
Deprecated
HTMLIsIndexElement
Deprecated
HTMLMenuItemElement
Deprecated
These interfaces offer access to the browser window and document that contain the HTML, as well as to the browser's state, available plugins (if any), and various configuration options.
BarProp
Navigator
Window
External
Deprecated
ApplicationCache
Deprecated
Plugin
Deprecated
PluginArray
Deprecated
These interfaces provide structure and functionality required by the elements used to create and manage forms, including the <form>
and <input>
elements.
FormDataEvent
HTMLFormControlsCollection
HTMLOptionsCollection
RadioNodeList
ValidityState
These interfaces represent objects used by the Canvas API as well as the <img>
element and <picture>
elements.
CanvasGradient
CanvasPattern
CanvasRenderingContext2D
ImageBitmap
ImageBitmapRenderingContext
ImageData
OffscreenCanvas
OffscreenCanvasRenderingContext2D
Path2D
TextMetrics
The media interfaces provide HTML access to the contents of the media elements: <audio>
and <video>
.
AudioTrack
AudioTrackList
MediaError
TextTrack
TextTrackCue
TextTrackCueList
TextTrackList
TimeRanges
TrackEvent
VideoTrack
VideoTrackList
These interfaces are used by the HTML Drag and Drop API to represent individual draggable (or dragged) items, groups of dragged or draggable items, and to handle the drag and drop process.
DataTransfer
DataTransferItem
DataTransferItemList
DragEvent
The History API interfaces let you access information about the browser's history, as well as to shift the browser's current tab forward and backward through that history.
BeforeUnloadEvent
HashChangeEvent
History
Location
PageTransitionEvent
PopStateEvent
These interfaces are used by the Web Components API to create and manage the available custom elements.
CustomElementRegistry
These supporting object types are used in a variety of ways in the HTML DOM API. In addition, PromiseRejectionEvent
represents the event delivered when a JavaScript Promise
is rejected.
DOMStringList
DOMStringMap
ErrorEvent
HTMLAllCollection
MimeType
MimeTypeArray
PromiseRejectionEvent
Several interfaces are technically defined in the HTML specification while actually being part of other APIs.
The Web Storage API provides the ability for websites to store data either temporarily or permanently on the user's device for later re-use.
Storage
StorageEvent
These interfaces are used by the Web Workers API both to establish the ability for workers to interact with an app and its content, but also to support messaging between windows or apps.
BroadcastChannel
DedicatedWorkerGlobalScope
MessageChannel
MessageEvent
MessagePort
SharedWorker
SharedWorkerGlobalScope
Worker
WorkerGlobalScope
WorkerLocation
WorkerNavigator
These interfaces, defined by the HTML specification, are used by the WebSockets API.
CloseEvent
WebSocket
The EventSource
interface represents the source which sent or is sending server-sent events.
EventSource