Javascript JQuery按钮会锁定一段时间
我在HTML网页上有一些按钮 单击一个后,我需要禁用其余的1分钟。我如何才能做到这一点 我还需要显示一分钟的计时器。我怎么做Javascript JQuery按钮会锁定一段时间,javascript,ajax,timer,Javascript,Ajax,Timer,我在HTML网页上有一些按钮 单击一个后,我需要禁用其余的1分钟。我如何才能做到这一点 我还需要显示一分钟的计时器。我怎么做 //start jquery.. $(function(){ //get the the click of the button $("#button").click(function(){ //disabled class toggle $(".toggle").prop('disabled', true); //enabled after 1
//start jquery..
$(function(){
//get the the click of the button
$("#button").click(function(){
//disabled class toggle
$(".toggle").prop('disabled', true);
//enabled after 1 minute
setTimeout( function(){
//here you enabled all the html of class toggle.
$(".toggle").prop('disabled', false);
}
, 60000 );
});
});
类切换的任何输入都将受到影响
此代码未经测试。Easy,Html有一个禁用的属性,您可以使用jquery或javascript将其添加到所需的元素中。只需构建一个计时器函数,该函数将在开始时添加此属性,并在一分钟后将其删除。我知道算法,但我需要查看其代码。请提供至少一些html和您投入的精力。有很多例子可以用来禁用某些东西。到目前为止你尝试过什么吗?谢谢,你太棒了。