Created
January 16, 2025 22:59
-
-
Save JanDW/57c741df401583e88c403afb28cc5df2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Creates MyElements extending HTML Element | |
class MyElement extends HTMLElement { | |
// Fires when an instance of the element is created or updated | |
constructor() { | |
super(); | |
} | |
// Fires when an instance was inserted into the document | |
connectedCallback() { | |
} | |
// Fires when an instance was removed from the document | |
disconnectedCallback() { | |
} | |
// Fires when an attribute was added, removed, or updated | |
attributeChangedCallback(attrName, oldVal, newVal) { | |
} | |
// Fires when an element is moved to a new document | |
adoptedCallback() { | |
} | |
} | |
// Registers custom element | |
window.customElements.define('my-element', MyElement); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment