Get Attribute for image
getting attr without ID
HTML
<script src="http://4.bp.blogspot.com/-uyvTMZ3dFPs/UKHsc_ZbysI/AAAAAAAACvo/QdVAlVBbUxE/s320/1hello.jpg"></script>
<img src="http://4.bp.blogspot.com/-uyvTMZ3dFPs/UKHsc_ZbysI/AAAAAAAACvo/QdVAlVBbUxE/s320/1hello.jpg" width='400' height='400' alt='Sample_image' onClick='imageInfo(this);'>
JavaScript
function imageInfo(this)
{
alert('image');
alert(this.src);
}