<script language=javascript>
function check()
{
  if(Form1.aa.checked==true) 
    {
  window.alert("checked");
}
}
</script>
<form name=Form1>
<INPUT id="aa" style="Z-INDEX: 101; LEFT: 201px; POSITION: absolute; TOP: 125px" type="checkbox" name="aa" runat="server">
<input type=button onclick="check();" value="测试">
</form>

解决方案 »

  1.   

    (window.document.form1.aa.checked==true)
      

  2.   

    if(document.getElementById("aa").checked)
       alert("checked")
      

  3.   

    xhbmj(让坏人更坏一点吧!) 
    谢谢!为什么if 语句必须写在funtion里面?
    我不用 button 难道就不可以调用吗?我希望能做到的是:检查checkBox 是否选中,直接if   为什么不可以?非常感谢!
      

  4.   

    <form  name=Form1>
    <INPUT id="aa" style="Z-INDEX: 101; LEFT: 201px; POSITION: absolute; TOP: 125px" type="checkbox" name="aa" runat="server">
    </form>
    <script>
    <!-- Begin Script
    if(document.Form1.aa.checked==true) 
             window.alert("checked");
    // -->
    </script>