LightningElement Class Properties
LightningElement is the base class for Lightning web components.
Properties that are specific to LightningElement include:
constructor: The constructor for theLightningElementclass.hostElement: Accesses theHTMLElementof the Lightning web component in shadow DOM and light DOM. See Access the Parent Element.- Template Access
template: The template for the Lightning web component. In light DOM components, usethisinstead ofthis.templateto access the template as there's no shadow root.refs: Accesses DOM elements in a specified template.
- Lifecycle Callbacks
connectedCallbackdisconnectedCallbackrenderrenderedCallbackerrorCallback
LightningElement is a wrapper of the standard HTMLElement interface. A custom Lightning web component, which extends LightningElement, inherits properties and methods from HTMLElement.
The inherited properties and methods are:
accessKeyaddEventListenerattachInternalschildrenchildNodesclassListdirdispatchEventdraggablefirstChildfirstElementChildgetAttributegetAttributeNSgetBoundingClientRectgetElementsByClassNamegetElementsByTagNamehasAttributehasAttributeNShiddenidisConnectedlanglastChildlastElementChildownerDocumentquerySelectorquerySelectorAllremoveAttributeremoveAttributeNSremoveEventListenersetAttributesetAttributeNSshadowRootspellcheckstyle(LWC API v62.0 and later)tabIndextagNametemplatetitle
LWC also reflects aria properties to support accessibility.
See Also