Q:

jquery on(live function)

Why this code is not working?
$("div.class ul li").on("click","a",function(){
        alert("A");
});

But this works fine...
$("body").on("click","div.class ul li a",function(){
    alert("A");
});

A:

I suppose that your div.class ul li is dynamically created. You need to call on function on some existing element (closest parent for example). This is why it works when called on body.

