<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>map</title> </head> <body> <p id="par"></p> <form method="post" action=""> <fieldset> <div> <label for="two">2</label> <input type="checkbox" value="2" id="two" name="number[]"> </div> <div> <label for="four">4</label> <input type="checkbox" value="4" id="four" name="number[]"> </div> <div> <label for="six">6</label> <input type="checkbox" value="6" id="six" name="number[]"> </div> <div> <label for="eight">8</label> <input type="checkbox" value="8" id="eight" name="number[]"> </div> </fieldset> </form> </body> </html> <script type="text/javascript" src="jquery.1.9.0.min.js"></script> <script type="text/javascript"> var par= $(':checkbox').map(function(index,item) { return { id:this.id, value:this.value }; }).get(); $("#par").html(JSON.stringify(par)); /* $("p").append( $("input").map(function(){ return $(this).val(); }).get().join(", ") );*/ </script>