Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var ids = [];
  2. $('#buttons').on('click','.allow',function(){
  3. console.log('clicked', $(this));
  4. ids.push($(this).attr('id'));
  5. setTimeout(
  6. function()
  7. {
  8. console.log(ids);
  9. }, 1000);
  10.  
  11. });
  12.  
  13. $('#both').on('click', function(){
  14.  
  15. triggerBoth();
  16.  
  17. });
  18.  
  19.  
  20. function triggerBoth(){
  21.  
  22. first = $('#first');
  23. second = $('#second');
  24.  
  25. first.addClass('allow');
  26. first.click();
  27. first.removeClass('allow');
  28.  
  29. second.addClass('allow');
  30. second.click();
  31. second.removeClass('allow');
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement