Disabling an element in jquery 1.6

家住魔仙堡 提交于 2019-12-05 01:24:23
$('.control').prop('disabled', true);

works fine for me.

Alternatively use

$('.control').attr('disabled', 'disabled');

Update:

But even $('.control').prop('disabled', 'disabled'); or $('.control').attr('disabled', true); disable the element too. So if it does not work for you, the question is really which element you are trying to disable. Can it be even disabled?

Make sure you haven't .removeProp('disabled') on the element you're trying to disable.

Use .prop('disabled', true).

http://jsfiddle.net/mattball/BaLHf/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!