我正在使用 jquery-1.7.2.min.js
我遇到类型错误:
$("#TextBox1").removeattr is not a function [Break On This Error]
$("#TextBox1").removeattr("disabled");
为什么?
最佳答案
正确的函数名称是removeAttr()
, 而不是 removeattr
:
$("#TextBox1").removeAttr("disabled");
但是从 jQuery 1.6 开始,最好使用 .prop()
disabled
和 checked
等原生属性的设置方法:
$('#TextBox1').prop('disabled', false);
关于jquery - 获取 "removeattr is not a function"异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11664359/