我的开/关开关有问题。我有一个代码不能正常工作,因为当我以它的形式写检查时它工作,但我想拖着心情,打开和关闭,当不写检查时它的形式不起作用,当我在两者中都写检查时,它不起作用,当我在其中一个中写检查时,它工作但不正确。:(
<script>
function DisEn(X){
document.A.T1.disabled=X;
document.A.T2.disabled=X;
}
</script>
</head>
<form name="A" method="get" action="switch.php">
<div class="onoffswitch">
<input type="checkbox" name="onoffswitch" value="off" class="onoffswitch-checkbox"
id="myonoffswitch" onClick="DisEn(false)" checked>
<input type="checkbox" name="onoffswitch" value="on" class="onoffswitch-checkbox"
id="myonoffswitch1" onClick="DisEn(false)" >
<label class="onoffswitch-label" for="myonoffswitch">
<div class="onoffswitch-inner"></div>
<div class="onoffswitch-switch"></div>
</label>
</div>
<input type="text" name="T1" value="A" disabled>
<input type="text" name="T2" value="B" disabled>
<input type="submit" name="T4" value="Submit" >
</form>