Last active
August 29, 2015 14:27
-
-
Save oleksapro/9d71d292641aa1318ecd to your computer and use it in GitHub Desktop.
as jquery
This file contains hidden or 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
$('a').click(function() { | |
var clicks = $(this).data('clicks'); | |
if (clicks) { | |
alert('odd number of clicks'); | |
} else { | |
alert('even number of clicks'); | |
} | |
$(this).data("clicks", !clicks); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment