<script type="text/javascript">
function myFunction() {
if (document.getElementById("ChkChildIssue").checked)
{
document.getElementById("dhamale").style.display="none";
document.getElementById("sachin").style.display="block";
}
else
{
document.getElementById("dhamale").style.display="block";
document.getElementById("sachin").style.display="none";
}
}
</script>
<body>
<input type="Checkbox" name="ChkChildIssuess" id="ChkChildIssue" onclick="myFunction();" />Include Child issue</br>
<div id="dhamale" > </div>
<div id="sachin" style="display:none;" > </div> // i want this div by default diaplay
选中复选框时,将隐藏 div "dhmale" 并显示 div "sachin" ,反之亦然。
但是,当复选框被选中时,不会显示 div "sachin"。
(document.getElementById("sachin").style.display="block" //this is not working