Created
May 15, 2014 16:51
-
-
Save paulmkoch/579d3d454d8358297f89 to your computer and use it in GitHub Desktop.
Element Has an Existing Data Attribute
This file contains 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
// 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