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 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.
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.
Dispatches an Event at the specified EventTarget.
The Event object to dispatch.
This instance for chaining.
StaticfromCreates a JJN instance from a Node reference.
The Node instance.
A new JJN 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 Node.
Remarks
This is the base class for all JJ wrappers. It provides common functionality for DOM manipulation, traversal, and event handling.
See
Node