Mega Code Archive

 
Categories / JavaScript Tutorial / JQuery
 

Each function and map array

< html>   <head>     <script type="text/javascript" src="js/jquery-1.3.2.js"></script>     <script type="text/javascript">         $(document).ready(function(){       var anArray = ['one','two','three',4];       var anObject = {one:1, two:2, three:3};       $.each(anArray,function(n,value){         document.write('['+n+']='+value);       });       $.each(anObject,function(n,value){         document.write('['+n+']='+value);       });         });     </script>   </head>   <body>     <body>         <p id="followMe">Follow me!</p>     </body> </html>