HTML中jquery控制button按钮可点击、不可点击

HTML中jquery控制button按钮可点击、不可点击

1.首先来说button按钮不可点击

1.1第一种(html代码中控制)

[cpp]  view plain  copy
  1. <button id="button_id"  disabled="disabled">按钮不可点击</button>  

1.2第二种(jquery控制)

[cpp]  view plain  copy
  1. $("#button_id").attr('disabled',true);  

2.按钮可点击

2.1第一种(html代码中控制,默认)

[cpp]  view plain  copy
  1. <button id="button_id">按钮可点击</button>  

2.2第二种(jquery控制)

[cpp]  view plain  copy
  1. $("#button_id").attr('disabled',false);  

转自:https://blog.csdn.net/csdnones/article/details/52238857

猜你喜欢

转载自blog.csdn.net/qq_36411874/article/details/79929175