例如如下:
        <input type=radio checked value=1 name=spIsCmtAllow id=allow>
        <input type=radio value=0 name=spIsCmtAllow id=reject>
当前选定的是第一个radio,我想在测试时按一个c#按钮使这个webbrowser中的第二个radio处于checked状态.第一个变为非checked状态.
如何做?

解决方案 »

  1.   


    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>未命名頁面</title>
    <script language="javascript" type="text/javascript">
    // <!CDATA[function Button1_onclick() {
    document.getElementById("allow").checked = false;
    document.getElementById("reject").checked = true;
    }// ]]>
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
        <input   type="radio"   checked   value="1"   name="spIsCmtAllow"   id="allow"> 
        <input   type="radio"   value="0"   name="spIsCmtAllow"   id="reject"> 
            <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /></div>
          
        </form>
    </body>
    </html>