<label class="switch switch-yes-no" id="check_'+id+'" style="margin: 0;font-weight: bold;">
<input class="switch-input" type="checkbox" id="check_'+id+'" />
<span class="switch-label" data-on="Published" data-off="Hidden"> </span>
<span class="switch-handle"></span>
</label>
我想禁用输入按钮。
答案 0 :(得分:0)
如果您想默认禁用该按钮,那么
<input class="switch-input" type="checkbox" id="check_'+id+'" disabled/>
如果你想在jquery
中的某些动作上禁用按钮$(function(){
$('#SomeButton').on('click', function(){
$('#your_input_id').attr('disabled' , 'disabled') //OR
$('#your_input_id').prop('disabled' , true) //true for disabled, false to enable
});
});
或者,如果您希望在页面加载时默认禁用而不执行任何操作
$(function(){
$('#your_input_id').attr('disabled' , 'disabled') //OR
$('#your_input_id').prop('disabled' , true) //true for disabled, false to enable
});