tuffT
10-21-2005, 05:16 PM
I am trying to pass the src of an image file to a function. The function is being called from a <a onclick="...."> tag.
If someone could tell me how this is possible I would be really grateful.
The code at the moment is as follows -
<a href="#" onclick="showImage(this.src)">
<img src="images/peopleThb/DSC_7982-1.gif" id="i1" />
</a>
I know its wrong at the minute, but I think I am on the right lines because if I put the onclick event handler into the img tag it works (but this is not well supported across browsers)
I want to pass the filename "images/peopleThb/DSC_7982-1.gif" to the function showImage.
If someone could tell me how this is possible I would be really grateful.
The code at the moment is as follows -
<a href="#" onclick="showImage(this.src)">
<img src="images/peopleThb/DSC_7982-1.gif" id="i1" />
</a>
I know its wrong at the minute, but I think I am on the right lines because if I put the onclick event handler into the img tag it works (but this is not well supported across browsers)
I want to pass the filename "images/peopleThb/DSC_7982-1.gif" to the function showImage.