Populating list elements

List elements are commonly used around the Web; they can be used to display search results, menus, and navigational items to name a few. Thanks to CSS, they no longer need to be boring, and it is possible to style list elements to make your data beautiful.

With jQuery, it is possible to populate a list element dynamically. This can be done directly from a JavaScript array via an AJAX response, with data from a web server or some other source.

Getting ready

Create a blank HTML document named recipe-9.html, and ensure that it is saved to a location where the latest version of jQuery can be included.

How to do it…

Learn how to dynamically populate a list with jQuery by performing each of the following recipes:

  1. In order to demonstrate ...

Get jQuery 2.0 Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.