按钮与a标签的禁用与启用总结

来源:互联网 发布:windows密码策略 编辑:程序博客网 时间:2024/06/05 19:43

Jquery 按钮的禁用

("#id")..attr({"disabled":"disabled"});

Jquery按钮的启用

("#id").removeAttr("disabled");

JavaScript 按钮的禁用

document.getElementById("#id").disabled=true;

JavaScript 按钮的启用

document.getElementById("#id").disabled=false;

禁用时间设置

资料:

js setTimeout参数传递使用介绍 http://www.jb51.net/article/40524.htm

介绍Windows setTimeout()方法 http://www.runoob.com/jsref/met-win-settimeout.html

备注:setTimeout() 只执行 code 一次。如果要多次调用,请使用 setInterval() 或者让 code 自身再次调用 setTimeout()。


Jquery a标签的禁用

法一:$("#id").removeAttr("href");

法二:$("#id").attr("href","#");

  $("#id").click(function(event){

event.preventDefault();//if the target="_blank",this code need to add.

  });

Jquery a标签click事件

可以通过添加flag禁用启用。








0 0
原创粉丝点击