- <ul >
- <input name="reason" type="checkbox" value="1"><span>产品使用一段时间后不工作了</span>
- <input name="reason" type="checkbox" value="2"><span>产品一收到就是坏的</span>
- <input name="reason" type="checkbox" value="3"><span>产品不能开机或自己启动</span>
- <input name="reason" type="checkbox" value="4"><span>产品不能充电</span>
- <input name="reason" type="checkbox" value="5"><span>产品外观非人为改变</span>
- <input name="reason" type="checkbox" value="6"><span>产品的内部或外部的损坏</span>
- <input name="reason" type="checkbox" value="7"><span>其他</span>
- </ul>
jquery代码
- function do_submit() {
- var reason_arr = new Array();
- $.each($("input[name='reason']"), function(){
- if(this.checked){
- reason_arr[i] = $(this).val();
- }
- });
- var vals = reason_arr.join(",");
- console.log(vals);
- }