Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Created November 19, 2019 21:53
Show Gist options
  • Save betweenbrain/7587859f07d3cc20ed01f44f16b50ab3 to your computer and use it in GitHub Desktop.
Save betweenbrain/7587859f07d3cc20ed01f44f16b50ab3 to your computer and use it in GitHub Desktop.

Revisions

  1. betweenbrain renamed this gist Nov 19, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. betweenbrain created this gist Nov 19, 2019.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    ## Using `querySelectorAll`
    ````
    const inits = this.$el.querySelectorAll('[ga-init]');
    inits.forEach(elem => {
    elem.removeAttribute('ga-init');
    elem.removeAttribute('data-ga');
    });
    ````

    ## Using `$children`
    ````
    const children = this.$children;
    children.forEach(elem => {
    elem.$el.removeAttribute('ga-init');
    elem.$el.removeAttribute('data-ga');
    });
    ````