<分区>
目前,我正在尝试实现的是在单击后禁用按钮并在 10 秒后重新启用。但它不起作用。 HTML代码
<td>
<asp:Button ID="btnResendOTP" runat="server" CssClass="button"
Text="Resend OTP" OnClientClick="disableButton()" OnClick="btnResendOTP_Click"/>
</td>
JS函数
<script type="text/javascript">
function disableButton() {
document.getElementById("<% btnResendOTP.ClientID %>").disabled = true;
setTimeout(function () { document.getElementById("<% btnResendOTP.ClientID %>").disabled = false; }, 10000);
}
</script>