Hi,
I’m new to jquery and javascript so sorry for asking such a simple question.
Link:
On this homepage each image has a unique title atrribute tag. The idea is that when a user hover’s a image, it’s title attribute tag displays inside “span.title”. When the user’s cursor leaves the image, it prints back “production & art direction”.
At this moment all images on hover are displaying only the first image title. Can someone please tell me what’s wrong with my code?
“`
$(function() {
$(‘img.pic’).hover(function() {
var title = $(this).attr(‘title’);
$(‘span.title’).text($(“img.pic”).attr(“title”));
}, function() {
$(‘span.title’).text(“production & art direction”);
});
});
Thanks!