Guest User

Untitled

a guest
Jan 19th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. $(this).attr("clicked") == "aa"
  2.  
  3. if ($(this).attr("clicked") == "aa"){
  4. alert("aa");
  5. }
  6.  
  7. <a id='Comedy' hoverb='green' clicked='aa'>want to laugh</a>
  8.  
  9. $('.left a').live("click", function() {
  10.  
  11.  
  12. if ($(this).attr("clicked") == "aa"){
  13.  
  14. $(this).css('background',black);
  15. alert("aa");
  16.  
  17. }
  18.  
  19. else {
  20.  
  21. //do somethingelse
  22.  
  23. }
  24.  
  25. });
  26.  
  27. <a id='Comedy' hoverb='green' data-clicked='aa'>want to laugh</a>
  28.  
  29. $('#Comedy').on('click', function(e) {
  30. e.preventDefault();
  31. if ($(this).data("clicked") == "aa") {
  32. alert("aa");
  33. }
  34. });​
  35.  
  36. $('#Comedy').on('click', function(e) {
  37. e.preventDefault();
  38. if ($(this).attr("clicked") == "aa") {
  39. alert("aa");
  40. }
  41. });​
  42.  
  43. $(this).css('background','black'); <---- black needs to be bound in '' ..Missing that
  44.  
  45. $(this).css('background',black);
  46.  
  47. $(this).css('backgrond','black');
Add Comment
Please, Sign In to add comment