-1
我想從JS pure構建一個定時器選擇器腳本。 但我一直在這個錯誤:js中的標籤錯誤
意外 ':' LOOP1
HTML:
<select id="hour1">
<option>1</option>
</select>
<select id="hour2"></select>
<select id="minute1"></select>
<select id="minute2"></select>
<select id="period"></select>
<select id="period"></select>
JS:
var hour1 = document.getElementById("hour1"),
hour2 = document.getElementById("hour2"),
minute1 = document.getElementById("minute1"),
minute2 = document.getElemetById("minute2"),
period = document.getElementById("period"),
hourCase1 = 0,
hourCase2 = 0,
minuteCase1 = 0,
minuteCase2 = 0;
Loop1:
for (;;) {
Loop2:
for (;hourCase2 <= 9;) {
hour1.innerHTML += "<option>" + hourCase1 + hourCase2 + "</option>";
hourCase2 += 1;
}
hourCase1 += 1;
if (hourCase1 == 1 && hourCase2 == 2) {
break Loop1;
}
}
非常感謝你
首先非常感謝你 – user6013662