Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Print Array Values with Loop</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ var fruitsArray = ["Apple", "Banana", "Orange", "Mango", "Pineapple"]; $.each(fruitsArray, function(index, value){ $("#result").append(index + ": " + value + '<br>'); }); }); </script> </head> <body> <div id="result"></div> </body> </html>