Appends children to this Element.
The children to append.
This instance for chaining.
Creates a Text node from a string and appends it to this Node.
Optionaltext: string | nullThe text to add. If null or undefined, nothing is added.
This instance for chaining.
Clones the Node.
Optionaldeep: booleanIf true, clones the subtree.
A new wrapped instance of the clone.
Removes all children from this Element.
This instance for chaining.
Finds the first element matching a selector within this Element.
The CSS selector.
Whether to throw an error if not found. Defaults to false.
The wrapped element, or null if not found and required is false.
Finds all elements matching a selector within this Element.
The CSS selector.
An array of wrapped elements.
Removes an event listener.
The name of the event.
The event handler.
Optionaloptions: boolean | EventListenerOptionsOptional event listener options or boolean.
This instance for chaining.
Adds an event listener.
The name of the event.
The event handler.
Optionaloptions: AddEventListenerOptionsOptional event listener options.
This instance for chaining.
The handler is automatically bound to this JJET instance, so this inside the handler
refers to the JJET instance, not the DOM element. To access the DOM element, use this.ref.
Prepends children to this Element.
The children to prepend.
This instance for chaining.
Runs a function in the context of this JJET instance.
The return value of the function.
If you want to access the current JJ* instance using this keyword, you SHOULD use a function not an arrow function.
If the function throws, run() doesn't swallow the exception.
So if you're expecting an error, make sure to wrap it in a try..catch block and handle the exception.
If the function returns a promise, you can await on the response.
Replaces the existing children of an Element with a specified new set of children.
The children to replace with.
This instance for chaining.
Sets the inner HTML of the ShadowRoot.
The HTML string to set, or null/undefined to clear.
Optionalunsafe: booleanexplicit opt-in to set innerHTML. must be true if html is provided.
This instance for chaining.
Dispatches an Event at the specified EventTarget.
The Event object to dispatch.
This instance for chaining.
StaticcreateCreates a new empty JJDF instance (wraps a new DocumentFragment).
A new JJDF instance.
StaticfromCreates a JJSR instance from a ShadowRoot reference.
The ShadowRoot instance.
A new JJSR instance.
StaticisChecks if a value can be passed to the wrap() or unwrap() function.
an unknown value
true if x is a string, Node (or its descendents), JJN (or its descendents)
StaticunwrapStaticunwrapStaticwrapWraps a native DOM node or string into the most specific JJ wrapper available.
The object to wrap. If it's already Wrapped, it'll be returned without any change. We don't double-wrap or clone it.
The most granular Wrapped subclass instance. If the input is already wrapped, it'll be returned as is without cloning.
Staticwrap
Wraps a DOM ShadowRoot (which is a descendant of DocumentFragment).
Remarks
The ShadowRoot interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document's main DOM tree.
ShadowRoot inherits DocumentFragment and therefore has access to all its methods most importantly
find, andfindAllwhich come handy to access and update its children.See
ShadowRoot