在javascript中单选按钮怎么验证是否选中

解决方案 »

  1.   

    在javascript中单选按钮怎么验证是否选中
    新手  指点指点
      

  2.   

    在javascript中单选按钮怎么验证是否选中
    新手  指点指点
      

  3.   

    好像是用这个"checked"
    判断这个
      

  4.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <script language="javascript">
    function checkform()
    {
    if (document.form1.book.checked)
    alert ("book is checked");
    if (document.form1.game.checked)
    alert ("game is checked");
    }
    </script>
    <body>
    <form name="form1" method="post" action="">
      <input type="radio" name="book" value="radiobutton">
      <input name="game" type="radio" value="radiobutton" checked>
      <input type="button" name="Submit" value="按钮" onClick="checkform()">  
    </form>
    </body>
    </html>