Wasim Wasim - 6 months ago 20
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

Use the live method:

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

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

Comments