jQuery 1.7's .on()
and .off()
methods are supposed to replace .live()
and such.
I tried it with a dynamic item:
$(".myList").on('click', function(e){
alert('hello world');
});
This is not working for me for elements added after DOM is loaded.
Is code above a valid example for jQuery 1.7's .on()
and .off()
methods?