- <html>
- <head><title>MARS TEST PAGE</title></head>
- <script>
- function chk(obj)
- {
- var boxArray = document.getElementsByName('c1');
- for(var i=0;i<=boxArray.length-1;i++){
- if(boxArray[i]==obj && obj.checked){
- boxArray[i].checked = true;
- }else{
- boxArray[i].checked = false;
- }
- }
- }
- </script>
- <body>
- <form name="form1">
- <input type="checkbox" name="c1" value="1" onclick="return chk(this);">A
- <input type="checkbox" name="c1" value="2" onclick="return chk(this);">B
- <input type="checkbox" name="c1" value="3" onclick="return chk(this);">C
- </form>
- </body>
- </html>
时间: 2024-10-30 08:13:43