Show input field only if a specific option is selected
here you go:
function yesnoCheck(that) {
if (that.value == "other") {
alert("check");
document.getElementById("ifYes").style.display = "block";
} else {
document.getElementById("ifYes").style.display = "none";
}
}
<select onchange="yesnoCheck(this);">
<option value="">Valitse automerkkisi</option>
<option value="lada">Lada</option>
<option value="mosse">Mosse</option>
<option value="volga">Volga</option>
<option value="vartburg">Vartburg</option>
<option value="other">Muu</option>
</select>
<div id="ifYes" style="display: none;">
<label for="car">Muu, mikä?</label> <input type="text" id="car" name="car" /><br />
</div>
Check out: Display div if a specific select option value is selected
Also don't use ID use data attributes or value to check comparison.