jquery设置不可编辑的方法

jquery设置不可编辑的方法

jQuery控制input不可编辑

1.开启disabled,是input不可以编辑

$("#id").attr("disabled","disabled");

2.关闭disabled

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

普通js中是这样写的,document.getElementById("id").disabled = false;

错误写法:$("#id").attr("disabled","false");

更多jquery的相关知识,可访问:web前端自学!!

以上就是jquery设置不可编辑的方法的详细内容,更多请关注易知道|edz.cc其它相关文章!

推荐阅读