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.

Revisions

  1. @ashwinkumar2438 ashwinkumar2438 revised this gist May 9, 2021. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions custom_define.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    //defining autonomous custom elements:
    customElements.define('my-element',MyElement);
    if(!customElements.get('my-element')){
    customElements.define('my-element',MyElement);
    }

    //defining customised button element:
    customElements.define('custom-button',CustomButton,{extends:'button'})
    if(!customElements.get('custom-button')){
    customElements.define('custom-button',CustomButton,{extends:'button'})
    }
  2. @ashwinkumar2438 ashwinkumar2438 created this gist May 9, 2021.
    5 changes: 5 additions & 0 deletions custom_define.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    //defining autonomous custom elements:
    customElements.define('my-element',MyElement);

    //defining customised button element:
    customElements.define('custom-button',CustomButton,{extends:'button'})