0 or 1
true or false
都可以!!

解决方案 »

  1.   

    boolean<input type="checkbox" id=a>
    <script>
    alert(a.checked);
    </script>类型当然是boolean型啦,只不过赋值的时候可以用1或0,而且2,3,5,6,7,a,b,什么的都可以,除了0之外都是true嘛,自动转换啦,C里面就有啦。
      

  2.   

    <input type="checkbox" id=a>
    <br>
    <input type=button onclick="a.checked = this.value" value="string '0'">
    <input type=button onclick="a.checked = this.value" value="1">
    <input type=button onclick="a.checked = this.value" value="a">
    <input type=button onclick="a.checked = this.value" value="b"><br>
    <input type=button onclick="a.checked = 0" value="int 0 notice this">
      

  3.   

    true or false
    你可以使用 alert(checked属性)来显示.