jquery 美化input checkbox 复选框
XML/HTML Code
- <div id="chklist">
- <input type="checkbox" value='1' checked/><label>aaaaaa</label>
- <input type="checkbox" value='2' /><label>bbbbbb</label>
- <input type="checkbox" value='3' /><label>ccccc</label>
- <input type="checkbox" value='4' /><label>ddddd</label>
- </div>
JavaScript Code
- <script type="text/javascript">
- (function(){
- $('#chklist').hcheckbox();
- $('#radiolist').hradio();
- $('#btnOK').click(function(){
- var checkedValues = new Array();
- $('#chklist :checkbox').each(function(){
- if($(this).is(':checked'))
- {
- checkedValues.push($(this).val());
- }
- });
-
- alert(checkedValues.join(','));
- alert($('#radiolist :checked').val());
- })
- );
- </script>
原文地址:http://www.freejs.net/article_biaodan_188.html