您现在的位置是:首页 > 电脑技术查询 > web开发

求JS控制Submit按钮 点击后10秒无法使用,该如何处理

编辑:chaxungu时间:2022-10-02 23:15:41分类:web开发

求JS控制Submit按钮 点击后10秒无法使用
HTML code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><script type="text/javascript"> function f_submit() { b1.disabled = "true"; }</script><body><form action="SaveOrderBySearchAir.aspx" method="post" name="Orderbyter" id="Orderbyter" onsubmit="return f_submit();"><input type="submit" class="sub" value="button" id="b1"/></form></body></html>

------解决方案--------------------
在点击的onclick事件中把input的disabled属性设成disabled
然后settimeout 十秒后再把disabled属性去掉