show all items in array - Javascript jQuery

Javascript examples for jQuery:Array

Description

show all items in array

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> 
  <script type="text/javascript">
    $(function(){//from  w w w .j ava  2 s.com
var field = ['Name Invalid', 'Email Invalid' , 'Phone Invalid' , 'Address Invalid','All Invalid'];
var alertStr = '';
$.each(field , function(i) {
    alertStr += field[i] + '\n'
 })
 console.log(alertStr)
    });

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials