Guest User

Untitled

a guest
Jul 11th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <script>
  2. window.onload = function() {
  3. var anchors = document.getElementsByTagName('a');
  4. for(var i = 0; i < anchors.length; i++) {
  5. var anchor = anchors[i];
  6. anchor.onclick = function() {
  7. alert('ho ho ho');
  8. }
  9. }
  10. }
  11. </script>
  12.  
  13. <script>
  14. window.onload = function() {
  15. var anchors = document.getElementsByTagName('a');
  16. for(var i = 0; i < anchors.length; i++) {
  17. var anchor = anchors[i];
  18. if(/bhohohob/).match(anchor.className)) {
  19. anchor.onclick = function() {
  20. alert('ho ho ho');
  21. }
  22. }
  23. }
  24. }
  25. </script>
  26.  
  27. <script>
  28. $(document).ready(function() {
  29. $('a').click(function() {
  30. alert('ho ho ho');
  31. });
  32. });
  33. </script>
  34.  
  35. <script>
  36. $(document).ready(function() {
  37. $('a.hohoho').click(function() {
  38. alert('ho ho ho');
  39. });
  40. });
  41. </script>
  42.  
  43. $(document).ready(function(){
  44. $("a").click(function(){
  45. alert("hohoho");
  46. });
  47. });
  48.  
  49. $('.myClass').click(function() {
  50. alert('hohoho');
  51. });
  52.  
  53. $(".myCssClass").click(function() { alert("hohoho"); });
  54.  
  55. document.body.onclick= function(e){
  56. e=window.event? event.srcElement: e.target;
  57. if(e.className && e.className.indexOf('someclass')!=-1)alert('hohoho');
  58. }
Add Comment
Please, Sign In to add comment