I have the new jquery-1.11.1.min.js I am setting up a click event on a class called '.drop' way before drop exists but it wont fire (unless the element was there at page load). I thought because of migrating from .bind and .click to .on there would be lots on google but I'm finding mostly old things.
google search:
I found this jQuery .on function for future elements, as .live is deprecated and this event fired by a future loaded element
but my code is the same as the answers and still it does nothing
I have a div.btn on the page at the start
Javascript:
$('body').on('click','.btn',function(){//this does happen!
$('body').append('<div class="drop"></div>');
});
$('body').on('click','.drop',function(e){console.dir(e);});//this never happens