Tag: jQuery .on()

How To Bind Multiple Events In JQuery?

Example: <!DOCTYPE html> <html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script> <script> $(document).ready(function() { $(‘button’).on(‘click dblclick’, function(){ $(‘#js’).addClass(‘hilighter’); }); }); </script> <style> .hilighter { background-color:yellow } </style> </head> <body> <p> Jquery is a library of <span id=”js”>JavaScript. </span></p> <br> <button> Click me or Double click </button> </html> </body> </html>

Posted in: HTML, jQuery, Solutions

Direct vs. Delegated – jQuery .on()

Method 1 (Direct): I want every span.green inside div#target to listen up: when you get clicked on, do X.

Posted in: jQuery, Solutions
Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .