Hello,
I have a js function inside the head of a page of mine which takes 2 arguments that are created dynamically based on what I retrieve from a database.
My question is whether I can set the attribute src of the <img> tag through the js function. What I have is:
[CODE]
<script type=”text/javascript”>
function HideShow(myVar, mySecondVar)
{
if (document.getElementById(myVar).style.display == ‘none’)
{
document.getElementById(myVar).style.display = ‘inline’
—–> mySecondVar.src = “css/images/show.gif”
}
else
{
document.getElementById(myVar).style.display = ‘none’
—–> mySecondVar.src = “css/images/hide.gif”
}
}
</script>
The lines with the arrow in front of them do not work, presumably there is a mistake in the syntax because I see no image…
I would greatly appreciate any help!