The document
variable that is available for the JavaScript editor shadows the global Document
object. Since Custom components are embedded in a shadow root, this type of document
variable is necessary to interact with the HTML configured for the Custom component.
Expected methods such as querySelector
and getElementById
should be available for the document
variable. Other methods, such as getElementsByClassName
, may not be available.
See the ShadowRoot documentation for more information.