我希望我的網頁上的按鈕切換我的兩個複選框的可見性。更改複選框的可見性
我該如何去實現這樣的功能?
<html>
<head>
<script language=javascript>
function validate(chk){
if (chk.style.visibility == 'visible')
chk.style.visibility = 'hidden';
else
chk.style.visibility = 'visible';
}
</script>
</head>
<body>
<form><span id=t style.visibility="visible" >
<input type=checkbox name=chk1>Please Check Me</span>
<input type=checkbox name=chk1>Please Check Me</span>
<p><input type=button value="check" onclick="return validate(t);">
</form>
</body>
</html>