求救,困扰了一天了, 急急急急急急急急急急急急,这个问题描述也太坑了吧。
6条回答 默认 最新
danielinbiti 2015-07-21 14:52关注<!DOCTYPE html> <html> <head> <script src="/jquery/jquery-1.11.1.min.js"> </script> <script> function getCheck(){ var arr=[]; $("input[type='checkbox']:checked").each(function(){ arr.push(this.value); }) var json = JSON.stringify(arr);//数组转换成json,都在了,数组和json alert(json); } </script> </head> <body> <input type='checkbox' value='1'/> <input type='checkbox' value='2'/> <input type='button' value='取值' onclick='getCheck()'/> </body> </html>本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报