Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulmkoch/579d3d454d8358297f89 to your computer and use it in GitHub Desktop.
Save paulmkoch/579d3d454d8358297f89 to your computer and use it in GitHub Desktop.
Element Has an Existing Data Attribute
// This macro looks for elements with data-track-event.
// To look for other attributes, replace "data-track-event" below.
// Note that it applies only to a specific element, and doesn't appropriately bubble.
function() {
var tracking = {{element}}.getAttribute('data-track-event');
if (tracking) {
return true;
} else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment