Dynamic List, returning the ID, Text or Unique value.
Hi, I have populated a list via XML but what I would like to have is the end user click on the list item so I can extract the content - but I do not know how to do this.
The list is populated through a for/next loop that builds the list - see below.
- $(xml).find('club').each(function()
- {
- $('#clubs').append('<li><a href="#">'+$(this).find('team').text()+'</a></li>');
- });
This outputs a list of 5 items in but obviously will vary over time.
How would I be able to extract the content of each item? i.e, A user clicks on a list item and either a unique id is returned or the value of the text is.
Cheers,
Lammie.