title: determining which item of a list was clicked- javascript
body: <p>I have a winJS list which is full of images. When a user clicks on an image, they are being sent to a second page. Is there any way of being able to determine which image the user clicked on page 1 (each image, when clicked, goes to the same page 2 but with a custom div). Here is my list declared and then I am push items to it:</p>
  
  <pre><code>var names_Array = [];
  
  var names_List = new WinJS.Binding.List(names_Array);
  
  var idPL;
  names_List.push({ name: "man 1", image: "image/man1.png", ClientID: "1111" });
  
  names_List.push({ name: "man 2 ", image: "image/man2.png", ClientID: "2222" }); 
  
  
  
  idPL = document.getElementById("names_List");
                   idPL.addEventListener("iteminvoked", onclickItem);
  
  
  function onclickItem(e) {
        console.log("Item clicked");
  }
  </code></pre>
  
  <p>A the minute I am populating the div based on which item was last pushed to the list, but I need this to be more flexible and be able to select the first item (even after a second one has been added)
  EDIT: I AM NOW GETTING AN ERROR 'Unable to get property 'addEventListener' of undefined or null reference'. I THOUGHT I had defined it in my code above </p>