|
I found the following code to change text based on user selection from a drop down list. I want to do the same thing, only I want to change an image based on the user selection.
Any ideas?
Thanks for the help!
<script type="text/javascript">
var textBlocks = new Array(
'Select a member',
'Member 1 text.',
'Member 2 text.');
function changetext(elemid) {
var ind = document.getElementById(elemid).selectedIndex;
document.getElementById("display").innerHTML=textB locks[ind];
}
</script>
</head><body>
<form>
<select id="whatever" onchange="changetext('whatever');">
<option value="0">Select</option>
<option value="1">Member1</option>
<option value="2">Member2</option>
</select><br>
</form>
<div id="display">Select a member</div>
</body></html>
|