Guest_imported
New member
- Jan 1, 1970
- 0
In the javascript, I want to change the some image source,
like:
before there is a image:
<img name="floorname" src="carpet.gif" border=0 width="98" height="37">
then I use the following code to change the image source to woodfloor.jpg:
carpet.source="woodfloor.gif";
now I want to test which picture is in "floorname",
I tried:
if(floorname.src == "carpet.gif"{
dosomething...
}
if(floorname.src == "woodfloor.gif"{
dosomething...
}
But the code does not work,
so what should I do to test the which image is in that picture "floorname"?
Thanks for any help!
like:
before there is a image:
<img name="floorname" src="carpet.gif" border=0 width="98" height="37">
then I use the following code to change the image source to woodfloor.jpg:
carpet.source="woodfloor.gif";
now I want to test which picture is in "floorname",
I tried:
if(floorname.src == "carpet.gif"{
dosomething...
}
if(floorname.src == "woodfloor.gif"{
dosomething...
}
But the code does not work,
so what should I do to test the which image is in that picture "floorname"?
Thanks for any help!