jquery 美化input checkbox 复选框
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>
相关推荐
开心就好 2020-06-10
huha 2020-10-16
TLROJE 2020-10-26
echoes 2020-08-20
nercon 2020-08-01
zhanghaibing00 2020-06-28
Aveiox 2020-06-25
henryzhihua 2020-06-21
zhoutaifeng 2020-06-17
liangzhouqu 2020-06-16
TONIYH 2020-06-11
x青年欢乐多 2020-06-06
KyrieHe 2020-06-03
bertzhang 2020-06-02
haokele 2020-05-29
niehanmin 2020-05-28
davidliu00 2020-05-26