Component element type
Insert components in the children list of this ElementComponent
’s parent, just after this ElementComponent
.
Components to insert
Insert component after the last child
Insert components in the children list of this ElementComponent
’s parent, just before this ElementComponent
.
Components to insert
Traverse the component and its parents (heading toward the document root) until it finds a component that matches the specified CSS selector.
Component element type
Run a function in the context of this component
Provides this component as the first argument and this
.
Check if component has class
true if component has all the specified classes
Append HTML.
Any components (provided as ${...}
inside the HTML string literal)
remain fully functional and are appended (not just as HTML).
Test whether the element would be selected by the specified CSS selector, or group of CSS selectors.
Add event listener
A case-sensitive string representing the event type to listen for.
The function that is called when an event of the specified type occurs.
An object that specifies characteristics about the event listener. See options
on MDN
Insert component before the first child
Remove the element
Replace classes
If all of these classes are present, they will be removed.
The classes to add if all oldClasses are present
Get the first component child that matches the specified CSS selector, or group of CSS selectors. If no matches are found, null is returned.
Component element type
Get all child components that match the specified CSS selector, or group of CSS selectors.
Component element type
Render this component in the place of a <slot name="…"></slot>
.
The slot name
Optional
parent: ParentNode = documentThe parent element within to search for slots. Defaults to document
DOMException When the slot is not found
Get this component's outer HTML
Static
fromCreate component from HTML code.
Note: only the first child of the HTML code will be used.
An HTMLElement component.
To create your own HTML component, it's recommended to extend this class.