我試圖在選擇特定選擇選項時顯示“expandrepeat”div。這是我不工作的代碼:<script>window.check=function(elem) { if (elem.selectedIndex == 1) { document.getElementById("expandrepeat").style.display = 'block'; } else { document.getElementById("expandrepeat").style.display = 'none'; }};</script>html:<div class="information-lane"><p class="information-title">{{trans.modal.repeat}}</p><select class="information-input form-control" onChange="check(this);"> <option value="-">No repeat</option> <option value="-">Daily</option> <option value="-">Weekly</option> <option value="-">Monthly</option> <option value="-">Yearly</option> <option disabled="disabled">–––––––––––––––––––––––––––––––––––––––––––––</option> <option value="-">Custom...</option></select></div><div id="expandrepeat" style="display:none;"> <p>Repeat every</p> <input></div>
- 0 回答
- 0 關注
- 145 瀏覽
添加回答
舉報
0/150
提交
取消