Wasim Wasim - 2 years ago 118
jQuery Question

Jquery.Hover not working for dynamic Element

Here is my code

$(".inboxfeedlist li").hover(function(e){alert('');}

This is not working for dynamically created elements, even i have use

$(".inboxfeedlist li").bind('hover',function(){})

is also not working, what's problem with code.

Answer Source

Use the live method:

$(".inboxfeedlist li").live('hover', function(e){alert('');});

A side note hover does take two callback functions, did you mean mouseover

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download