Get Attribute for image

getting attr without ID

by subhash9

HTML

<script src="http://4.bp.blogspot.com/-uyvTMZ3dFPs/UKHsc_ZbysI/AAAAAAAACvo/QdVAlVBbUxE/s320/1hello.jpg"></script>
<img src="./images/image1.jpg" width='100' height='100' alt='Sample image'>

JavaScript

$('img').click(function()
{
    alert(this.src);
});