我试图在选择特定选择选项时显示“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>
Cats萌萌
相关分类