<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>
<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>
<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>
<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(韩宾)
<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>