Sunday, 8 September 2013

get img path on clisk with jquery

get img path on clisk with jquery

I am currently trying to get the path of an image when clicking on it
using jquery. The images is printed out in a loop using php. Is there a
command in jquery to fetch the img src?
here is my jquery:
<script>
$(document).ready(function() {
$(\"#gallerythumbnail\").click(function( event ) {
alert(\"The img source/path???\");
});
});
</script>
and the img tag:
<img src='".$picsarray[$picsfrom]."' id='gallerythumbnail'>
does someone know how to do this? any help is greatly appreciated :)

No comments:

Post a Comment