Javascript examples for jQuery Method and Property:live
Apply jquery hover for multiple elements
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.js"></script> <script type="text/javascript"> $(window).load(function(){/*ww w . j av a 2s. com*/ $('div').live('click', function() { $(this).html('clicked'); }); $('div:first').add('div:last').click(); }); </script> </head> <body> <div> test1 </div> <div> test2 </div> <div> test3 </div> </body> </html>