click on listview item

click on listview item

i searched lots of pages but could not get this simple question answered:

How can i handle a click on a listview item?

I have this listview:

  1. <ul id="menu" data-role="listview">
  2.       <li><a href="#">link1</a></li>
  3.       <li><a href="#">link2</a></li>
  4.       <li><a href="#">link3</a></li>
  5.       <li><a href="#">link4</a></li>
  6.       <li><a href="#">link5</a></li>
  7. </ul>

tried this function to handle my click:

  1. $("#menu").click(function () {
  2. alert("click");
  3. });

my test-alert is not showing when clicking on any of that listview items. i also tested to set an id on the listview-item itself, same problem.

How should i handle onclick-event on a listview?

Any help is welcome.

Thanks

Michael