javascript当中radio的用法
5.radio
例 5.1(RadioReferenceIEFF.html)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript">
function clickH()
{
var form = document.forms[0];
if (form.school[0].checked)
{
form.school[1].checked = true;
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD=POST ACTION="">
清华<INPUT TYPE="radio" NAME="school" value="th" checked><br>
北大<INPUT TYPE="radio" NAME="school" value="bd"><br>
<INPUT TYPE="button" value="变" onClick="clickH()"/>
</FORM>
</BODY>
</HTML>
更多内容请见原文,文章转载自:https://blog.csdn.net/qq_43650923/article/details/102515515