I have the following JavaScript code for a simple hover which uses JQuery:
$('.product_img_link').hover(function(){
$(this).prev('.hoverProduct').show();
},function(){
$(this).prev('.hoverProduct').hide();
});
(finds the previous div
with class hoverProduct
, and displays it on hover and hides it on mouse out).
How can I write this snippet without JQuery, using only plain JavaScript?