js如何通过CheckBox值显示/隐藏RadioButton,实现方法如下:

<html> 
<head> 
<style type=\"text/css\"> 
#myGroup {visibility:hidden} 
</style> 
<  type=\"text/ \"> 
function toggle(chkbox, group) { 
    var visSetting = (chkbox.checked) ? \"visible\" : \"hidden\"; 
    document.getElementById(group).style.visibility = visSetting; 
} 
function swap(radBtn, group) { 
    var modemsVisSetting = (group == \"modems\") ? ((radBtn.checked) ? \"\" : \"none\") : \"none\"; 
    document.getElementById(\"modems\").style.display = modemsVisSetting; 
} 
</ > 
</head> 
<body> 
    <form> 
        <input type=\"checkbox\" name=\"monitor\"  =\"toggle(this, \'myGroup\')\" />Monitor
        <span id=\"myGroup\"><input type=\"radio\" />15</span>
    </form> 
</body> 
</html>
收藏 打印