If I've got an image listed as (for example):
<img src="image1.gif" name="image1">
Then I can change that image with an event such as (for example):
<a href="..." onmouseover="document.images.button1.src='image2.gif'">
However I am stuck trying to get a general function to sit in the page's head section that I can pass in as strings the image name and the new src field. I know there's a way because I see a similar example in a book I'm working from, but I can't quite get the syntax or whatever. Any help?
<img src="image1.gif" name="image1">
Then I can change that image with an event such as (for example):
<a href="..." onmouseover="document.images.button1.src='image2.gif'">
However I am stuck trying to get a general function to sit in the page's head section that I can pass in as strings the image name and the new src field. I know there's a way because I see a similar example in a book I'm working from, but I can't quite get the syntax or whatever. Any help?