JQuery 按钮锁定一段时间
JQuery buttons lock for some time
我在 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 minute
setTimeout( function(){
//here you enabled all the html of class toggle.
$(".toggle").prop('disabled', false);
}
, 60000 );
});
});
任何 class 切换的输入都会受到影响 <button class="toggle"></button>
ps。此代码未经测试。
我在 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 minute
setTimeout( function(){
//here you enabled all the html of class toggle.
$(".toggle").prop('disabled', false);
}
, 60000 );
});
});
任何 class 切换的输入都会受到影响 <button class="toggle"></button>
ps。此代码未经测试。