JS让RADIO不显示问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 22:52:10
我怎么让两个单选按扭都不可用呢?这个方法只能让一个不可用...
<html>
<head>
<script language = "JavaScript">
function changeValue(){
document.getElementById("show").disabled = true;
}
</script>
</head>
<body>
moom<input type = "radio" name = "show" value = "1" checked = true/>
sky<input type = "radio" name = "show" value = "2"/><br>
<p>
<input type = "button" value ="change" onclick = "changeValue()"/>
</body>
</html>
谢谢好心人帮忙回答一下~

给两个radio 加上id属性值要不同
moom<input type = "radio" name = "show" id = "show" value = "1" checked = true/>
sky<input type = "radio" name = "show" id = "showA" value = "2"/><br>

然后
<script language = "JavaScript">
function changeValue(){
document.getElementById("show").disabled = true;
document.getElementById("showA").disabled = true; }
</script>