<div class="item">
<p><img src="images/photos_sample1.jpg"
border="0" rel="images/google_map.jpg"></p>
<p>Dining Area</p>
</div>
<div class="item">
<p><img src="images/photos_sample2.jpg"
border="0" rel="images/sample_photo.jpg"></p>
<p>Pool Area</p>
</div>
I have this html code, and I want to get the rel attribute's value when I click the image.I wrote this jquery script, but seems not work
$('div.item').click(function() {
var getvalue = $('this > p > img').attr('rel');
alert(getvalue);
});