Mega Code Archive

 
Categories / JavaScript Tutorial / JQuery
 

Map(callback) builds lists of values, attributes, css values

< html>   <head>     <script type="text/javascript" src="js/jquery-1.3.2.js"></script>     <script type="text/javascript">         $(document).ready(function(){                              $("p").append( $("input").map(function(){                 return $(this).val();             }).get().join(", ") );                              });     </script>   </head>   <body>     <body>           <p></p>           <form>                      <input type="text" name="name" value="A"/>             <input type="text" name="password" value="B"/>           </form>     </body> </html>