http://topic.csdn.net/u/20100301/11/fc36bae2-e53a-4d7c-9066-551f8dd4de61.html
代码实现:
条件:
1个Label
有多个 CheckBox
问题:
当 CheckBox(N) 的 Checked 为 true 时,向 Label 的 Text 添加 "CheckBox(N)选中".为 false 时,如果 Label 的 Text 有 "CheckBox(N)选中" 则把它删除掉,其他的保持不变.
当有多个 CheckBox(N) 的 Checked 为 true 时,请用 "," 隔开.
除非 所有的 CheckBox 的 Checked 为 true 则 Label 的 Text 为 "以全选",为 false 则 Label 的 Text 为 "未选中".
----------------------------------------------------------------------------------------------------------------------------------------------
// --></mce:script>
</HEAD>
<BODY>
选中情况:<br>
<span id='span'></span><br>
1<input type='checkbox' value='0' onclick='change(this);' />
2<input type='checkbox' value='1' onclick='change(this);' />
3<input type='checkbox' value='2' onclick='change(this);' />
4<input type='checkbox' value='3' onclick='change(this);' />
5<input type='checkbox' value='4' onclick='change(this);' />
</BODY>
</HTML>