javascript - 单击后禁用按钮并且应该适用于所有类型的浏览器?

标签 javascript asp.net

function disableLbtSend() {
  document.getElementById('<%=Buttonclick.ClientID%>').disabled= true;
}
window.onbeforeunload = disableOgSend;  

我想在单击一次后禁用按钮,并为其编写了上面的代码。它在 IE 中工作正常,但在 chrome 和 Mozilla 中不行。应该做什么才能得到所需的解决方案

最佳答案

try this using jquery:

function disableLbtSend() { 
    $('#' + '<%= Buttonclick.ClientID %>').attr("disabled", "disabled");
}

关于javascript - 单击后禁用按钮并且应该适用于所有类型的浏览器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44626063/

相关文章:

javascript - 使用 javascript 操作 php 变量和函数

javascript - 使用选定的表格行预填充选择下拉列表

无法访问 JavaScript __proto__

javascript - 变量超出范围?

javascript - 函数 result.charAt 不存在

c# - 在 silverlight 中的页面上播放视频

c# - 403消息: Legacy People API has not been used in project

javascript - 设置间隔和 AJAX

JavaScript 图片本地路径

ASP.NET Session_End 参数?