0
我有此代码并正常工作,但是当我清除文本字段复选框仍然检查我该怎么办?复选框禁用当文本框中的金额超过
<form name="form1">
<div class="controlset-pad">
<input type="checkbox" name="others" onclick="enable_text(this.checked)" class="medium" disabled='disabled'/>
</div>
<input type="checkbox" name="others" onclick="enable_text(this.checked)" class="medium" disabled='disabled'/>
</div>
$('input[name=other_name]').keyup(function(){
if (this.value.length > 0) {
$('input[name="others"]').prop('disabled', false)
} else {
$('input[name="others"]').prop('disabled', true)
}
})
建议增加与KEYUP以及其他活动占鼠标事件等。 – Iceman