Reputation: 1271
I'm ajaxing some search results onto a page, and trying to do stuff when the user hovers over results. Here's what I've got:
$(".preview").live("hover", function(){ console.log('hovered');} )
Each of the results has the class "preview". Why isn't anything happening?
Edit: Here's where the HTML is coming from:
var preview="<img class='previews' src='http://i.ytimg.com/vi/"+vid+"/default.jpg' /> ";
Upvotes: 0
Views: 408
Reputation: 4665
Your selector is for the class "preview", and your actual html is with the class "previews": Your selector will never match the element ;)
Upvotes: 2