I want to catch the title attribute of a element from multiple elements having the same class, but different attributes.
This is what I have tried:
HTML
<div title="title1" class="pager" onclick="location.href='link.aspx';></div>
<div title="title2" class="pager" onclick="location.href='link.aspx';></div>
<div title="title3" class="pager" onclick="location.href='link.aspx';></div>
<a class="pagerTitle"></a>
jQuery
$(".pager").bind("mouseover", function() {
$(".pagerTitle").text(this.attr("title"));
});
But it is not working. What is the correct method to do so?