Dynamic List, returning the ID, Text or Unique value.

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.  
  1. $(xml).find('club').each(function()
  2. {
  3. $('#clubs').append('<li><a href="#">'+$(this).find('team').text()+'</a></li>');
  4. });
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.
    • Topic Participants

    • paul