我想禁用点击控制,因为我已将attr添加到控件'禁用',它在IE中工作正常但在Firefox中没有.我写的代码是
$(obj).attr('disabled','disabled');
Run Code Online (Sandbox Code Playgroud)
如果我遗失了什么,那么请给我一些想法.
试试这个
$(obj).attr("disabled","disable")
Run Code Online (Sandbox Code Playgroud)
注意属性"禁用"的值是"禁用"而不是"disabl*ed*"
这是我用来禁用或重新启用控件的代码:
function handleControlDisplay(className, foundCount, checked) {
var button = jQuery(className);
if (foundCount > 0 && foundCount == checked) {
// enable
button.removeAttr("disabled");
}
else {
// set the disabled attribute
button.attr("disabled", "true");
};
}
Run Code Online (Sandbox Code Playgroud)