-
-
Save tommcfarlin/c2d33cce48603de444d2a620927f32da to your computer and use it in GitHub Desktop.
[JavaScript] Dynamic Elements, Static Elements, Event Handlers and Their Complexities
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
$('.acme-element').each(function(e) { | |
var $anchor = $(this).parents('a'); | |
$(this).on('click', function(evt) { | |
if(e.target !== this) { | |
evt.preventDefault(); | |
} | |
// Here, you may want to action to redirect to an original anchor. | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment