Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- window.onload = function() {
- var anchors = document.getElementsByTagName('a');
- for(var i = 0; i < anchors.length; i++) {
- var anchor = anchors[i];
- anchor.onclick = function() {
- alert('ho ho ho');
- }
- }
- }
- </script>
- <script>
- window.onload = function() {
- var anchors = document.getElementsByTagName('a');
- for(var i = 0; i < anchors.length; i++) {
- var anchor = anchors[i];
- if(/bhohohob/).match(anchor.className)) {
- anchor.onclick = function() {
- alert('ho ho ho');
- }
- }
- }
- }
- </script>
- <script>
- $(document).ready(function() {
- $('a').click(function() {
- alert('ho ho ho');
- });
- });
- </script>
- <script>
- $(document).ready(function() {
- $('a.hohoho').click(function() {
- alert('ho ho ho');
- });
- });
- </script>
- $(document).ready(function(){
- $("a").click(function(){
- alert("hohoho");
- });
- });
- $('.myClass').click(function() {
- alert('hohoho');
- });
- $(".myCssClass").click(function() { alert("hohoho"); });
- document.body.onclick= function(e){
- e=window.event? event.srcElement: e.target;
- if(e.className && e.className.indexOf('someclass')!=-1)alert('hohoho');
- }
Add Comment
Please, Sign In to add comment