Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image source

Status
Not open for further replies.

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=&quot;floorname&quot; src=&quot;carpet.gif&quot; border=0 width=&quot;98&quot; height=&quot;37&quot;>

then I use the following code to change the image source to woodfloor.jpg:
carpet.source=&quot;woodfloor.gif&quot;;

now I want to test which picture is in &quot;floorname&quot;,
I tried:
if(floorname.src == &quot;carpet.gif&quot;){
dosomething...
}

if(floorname.src == &quot;woodfloor.gif&quot;){
dosomething...
}

But the code does not work,
so what should I do to test the which image is in that picture &quot;floorname&quot;?
Thanks for any help!
 
not sure if this si the problem, but take out any bold stuff you have here:

carpet.source=&quot;woodfloor.gif&quot;;
jaredn@subdimension.com -
 
and also, make sure the image exists ..
&quot;I use the following code to change the image source to woodfloor.jpg:
carpet.source=&quot;woodfloor.gif&quot;;&quot;

 
also, i believe that if you named your image 'floorname', then to change the image source it should be:

floorname.src=&quot;woodfloor.gif&quot;;

since you havent used 'carpet' anywhere else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top