Javascript examples for jQuery Method and Property:bind
Bind a click event to a div block generated on the fly using jquery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> <script type="text/javascript"> $(window).on('load', function() { $(document).on('click', ".mootoo", function() { console.log("clicked"); });/* ww w . ja v a 2 s . co m*/ $('body').append('<div class="hi">test</div>'); }); </script> </head> <body> </body> </html>