js和jquery设置disabled属性为true使按钮失效

内容摘要
设置disabled属性为true即为不可用状态。
JS


document.getElementByIdx("btn").disabled=true;

jquery


$("#btn").attr("disabled", true);

html


<input type="butt
文章正文

设置disabled属性为true即为不可用状态。

JS

document.getElementByIdx("btn").disabled=true;

jquery

$("#btn").attr("disabled", true);

html

<input type="button" value="提交" id="btn">

代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!