Bik*_*iki 1 jquery jquery-ui jquery-selectors
我想一次性禁用所有复选框,所有下拉列表和文本框(按钮除外),这些都出现在我的页面中.
以下代码无效,请纠正.
$('checkbox').filter('type=[button]').attr("disabled", "disabled");
$('input').filter('type=[button]').attr("disabled", "disabled");
$('select').filter('type=[button]').attr("disabled", "disabled");
Run Code Online (Sandbox Code Playgroud)
注意:我不想禁用页面中的按钮.
假设您正在使用jQuery v1.6.*,那么您应该使用它.prop("disabled", true).
$('input[type="text"], input[type="checkbox"], select').prop("disabled", true);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7137 次 |
| 最近记录: |