我喜欢在提交按钮上设置延迟。换句话说,点击该按钮后几秒钟变灰。我如何使用 js 完成此操作?
最佳答案
这可能对您有帮助:http://jsfiddle.net/jhNcM/
<input type="button" id="aaa" value="button" />
$('#aaa').click(function() {
var aaa = $(this);
aaa.prop('disabled', true);
setTimeout(function() {
aaa.prop('disabled', false);
}, 3000);
});
关于javascript - 设置提交按钮的延迟; ID。单击后按钮灰色并禁用 x 秒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13361483/