I have this select option:
<div class="okreci_select">
<select onchange="changeImage(this)" id="selectid">
<option value="samsung">Samsung</option>
<option value="apple">Apple</option>
<option value="lg">LG</option>
<option value="htc">HTC</option>
</select>
</div>
And I have this js function:
function changeImage(el) {
if (el.value == "samsung"){
document.getElementById("IzabranUredjajSl").src = "Slike/uredjajSamsung.png";
document.getElementById("prom_vr_kara").innerHTML = "- 5.1” / 2560x1440 ekran <br/> - 12 MP / 5 MP kamere <br/> - Octa-core / 4 GB platforma <br/> - do 32 GB memorije ";
}
else if(el.value == "apple"){
document.getElementById("IzabranUredjajSl").src = "Slike/uredjajApple.png";
document.getElementById("prom_vr_kara").innerHTML = "- 4.7” / 1334x750 ekran <br/> - 12 MP / 7 MP kamere <br/> - Quad-core / 2 GB platforma <br/> - do 32 GB memorije ";
}
}
How can I use the fadein() method when the el.value is equal to something. For example, when the value is apple, I want the uredjajApple.png to fadein. I've tried:
document.getElementById("IzabranUredjajSl").src = "Slike/uredjajApple.png".fadein();
But it doesn't work. Same goes for the text (innerHTML), how do I make them fade in when the el.value changes?