46
rated 0 times
[
50]
[
4]
/ answers: 1 / hits: 24382
/ 10 Years ago, sun, august 31, 2014, 12:00:00
I have one image (img.png
), with its content changing after a combo box changes.
The problem is the content of the image doesn't change when I change the combo box on the page.
I tried to use JavaScript like this:
function SwitchPic(pic) {
pic.src = img.png;
}
and the img
tag is:
<img src='img.png' id='img1' name='img1'>
and the combo box tag is:
<select name=users onchange=show(this.value);SwitchPic(img1);>
<option value=>Select a Number:</option>
<option value=a>a</option>
<option value=b>b</option>
<option value=c>c</option>
</select>
It worked the first time I change the option, but when I re-change the option, it keeps the image without changing it.
How can I solve this?
More From » html