Skip to content

Instantly share code, notes, and snippets.

@martinandersen3d
Forked from ashwinkumar2438/custom_define.js
Created January 15, 2023 22:43
Show Gist options
  • Save martinandersen3d/66b2566d127d716635fa73cccac873b6 to your computer and use it in GitHub Desktop.
Save martinandersen3d/66b2566d127d716635fa73cccac873b6 to your computer and use it in GitHub Desktop.
//defining autonomous custom elements:
if(!customElements.get('my-element')){
customElements.define('my-element',MyElement);
}
//defining customised button element:
if(!customElements.get('custom-button')){
customElements.define('custom-button',CustomButton,{extends:'button'})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment