我正在试着点击一个按钮来重置bootstrap输入微调器。我尝试使用document.getelementbyId().value = "0“,但没有成功。我也尝试过使用reset(),但它不起作用。对如何重置有什么想法吗?
function resetScoreSing() {
document.getElementById("scoreSing1").reset();
document.getElementById("scoreSing2").reset();
}
<div class="container" style="width: 160px;"><input type="number" value="0" step="1" id="scoreSing2"></div>
button type="button" class="clear" id="RSSing" onclick="resetScoreSing()">Reset Score</button>发布于 2020-10-06 05:21:37
它在以下情况下工作:
$("#scoreSing1").val('0');
$("#scoreSing2").val('0');https://stackoverflow.com/questions/64215708
复制相似问题