Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. (function () {
  2. var eventLog = [];
  3.  
  4. $(document).ready(function () {
  5. $('#target-element').on('click', trackEvent);
  6. });
  7.  
  8. function trackEvent(e) {
  9. eventLog.push(e);
  10. }
  11. })();
  12.  
  13. $(document).on('click',function(e) {
  14. if(e.target.id==='target-element') {
  15. eventLog.push(e);
  16. }
  17. });
  18.  
  19. $(document).on('click','#target-element',function(e) {
  20. eventLog.push(e);
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement