So when my value is gsm i just need an alert with ("nice it works") but it doesn't want to work! Can you guys help me out? Without changing to much of my code? Unless it's really wrong ofcourse.
This is my Html:
<select id="telefoonkeuze" onchange="Checkfunction()">
<option value="gsm" id="gsm">gsm</option>
<option value="telefoon">telefoon</option>
</select>
This is my js:
var gsm = document.getElementById("gsm");
function Checkfunction() {
var x = document.getElementById("telefoonkeuze").value;
if (x == gsm) {
alert("nice it works!");
}
}
Aucun commentaire:
Enregistrer un commentaire