<input type="checkbox" name="shit" value="1" id="1" onclick="show(this)">aaa  
<input type="checkbox" name="shit" value="2" id="2" onclick="show(this)">bbb  
<input type="checkbox" name="shit" value="3" id="3" onclick="show(this)">ccc
<SCRIPT>
     function show(obj){
      if(obj.checked == true){
      alert(obj.value);
      }
     }</SCRIPT>

解决方案 »

  1.   

    对不起阿,我的意思是选择checkbox中的选项,然后在网页中显示出来,最好用document.writeln()输出所选的项,当再次点击该checkbox选项时,刚才显示的内容就会消失,不知道我这么说,你能理解吗?
      

  2.   

    <input type="checkbox" name="shit" value="1" id="1" onclick="show(this,shit1)"><span id="shit1">请选择</span>  <br>
    <input type="checkbox" name="shit" value="2" id="2" onclick="show(this,shit2)"><span id="shit2">请选择</span>  <br>
    <input type="checkbox" name="shit" value="3" id="3" onclick="show(this,shit3)"><span id="shit3">请选择</span>  <br>
    <SCRIPT>
         function show(obj,spanId){
         if(obj.checked == true){
             spanId.innerHTML = obj.value;
         } else {
          spanId.innerHTML = "请选择";
         }
         }</SCRIPT>
      

  3.   

    <input type="checkbox" name="shit" value="1" id="1" onclick="show(this,shit1)"><span>1</span>  <br>
    <input type="checkbox" name="shit" value="2" id="2" onclick="show(this,shit2)"><span>2</span>  <br>
    <input type="checkbox" name="shit" value="3" id="3" onclick="show(this,shit3)"><span>3</span>  <br>
    <span id="shit1"></span>
    <span id="shit2"></span>
    <span id="shit3"></span>
    <SCRIPT>
         function show(obj,spanId){
         if(obj.checked == true){
             spanId.innerHTML = obj.value;
         } else {
          spanId.innerHTML = "";
         }
         }</SCRIPT>
    谢谢 lion98(韩宾)
      

  4.   

    <input type="checkbox" name="shit" value="1" id="i1" onclick="show()">aaa  
    <input type="checkbox" name="shit" value="2" id="i2" onclick="show()">bbb  
    <input type="checkbox" name="shit" value="3" id="i3" onclick="show()">ccc你选了:<font id=list></font>
    <script>
    function show(checked)
    {
    var chk = document.getElementsByName("shit");
    s = "";
    for(var i=0;i<chk.length;i++)
    {
    if(chk[i].checked)
    {
    if(i!=chk.length)
    s += chk[i].value+",";
    else
    s += chk[i].value;
    }
    }
    list.innerHTML = s;
    }
    </script>