JavaScripture
Contribute via GitHub Feedback

CustomElementRegistry : Object

Provides a way to extend HTML/DOM with your own elements that have custom logic similar to built in elements. Exposed as customElements. See also CustomElementPrototype.

Instance Methods

define(tagName : String, type : CustomElementPrototype) : undefined

Registers a new custom element type for the specified tagName. tagName must have a '-' in it.

Example:

Run

Results:

 

get(tagName : String) : CustomElementPrototype

Returns the prototype for the specified tagName that was previously registered with define.

Example:

Run

Results:

 

whenDefined(tagName : String) : Promise

Returns a Promise that resolves after a custom element is defined for the specified tagName.

Example:

Run

Results: