Почему при конструкции switch case "0" работает, а case "1" и case "2" нет?
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Выбор</title>
</head>
<body id="0">
<input type="button" value="1" id="decis1" onclick="numb(1);">
<input type="button" value="2" id="decis2" onclick="numb(2);">
<script>
function numb(decis) {
switch (curScene) {
case "0":
if (decis == 1) {
curScene = 1;
alert("case 0: decis == 1");
}
else {
curScene = 2;
alert("case 0: decis == 2");
}
break;
case "1":
if (decis == 1) {
alert("case 1: decis == 1");
}
else {
alert("case 1: decis == 2");
}
break;
case "2":
if (decis == 1) {
alert("case 2: decis == 1");
}
else {
alert("case 2: decis == 2");
}
break;
}
}
var curScene = document.getElementById("0").id;
</script>
</body>
</html>