How to get javascript to change an image source depending...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
compuXP
Forum Newbie
Posts: 17
Joined: Sat Feb 26, 2005 11:19 am

How to get javascript to change an image source depending...

Post by compuXP »

Hi,

How can I get javascript to change an image's source when the user clicks on a different list item for a <select> thing on my form?

So, if the item's VALUE is "4" then it displays "sample4.png" on that image...

How can I do this? Thanks,

-compuXP
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

<select onchange=&quote;your_function(this)&quote;>
we've talked about this, not necessarily specifically, but we've talked about it.

http://devguru.com/Technologies/ecmascr ... image.html for information on what properties you can play with in an image object.
compuXP
Forum Newbie
Posts: 17
Joined: Sat Feb 26, 2005 11:19 am

Post by compuXP »

Ah thank you :) I got it now ;)
Post Reply