Javascript examples for jQuery:Array
for each array item and create <LI>
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(function() {/* www . j ava 2 s . com*/ var data = ['Gmail', 'Docs', 'Android']; var products = $('#products'); $(data).each(function(index, value) { products.append('<li>' + value + '</li>'); }); }); </script> </head> <body> My favorite Google products: <ul id="products"></ul> </body> </html>