Jim
Jim

Reputation: 9234

jquery mobile: list view, on split button click

I have list view, each list item has split button 'delete'. How to determine which item was clicked ?

Here is my example: http://jsfiddle.net/gDea8/83/

$("#listview a.ui-li-link-alt").live("click", function(e){
  alert('which item ? 1,2,3 or 4 ?'); 
});

Upvotes: 0

Views: 454

Answers (1)

Roko C. Buljan
Roko C. Buljan

Reputation: 206008

$("#listview a.ui-li-link-alt").live("click", function(e){
      alert($(this).parent().index() +1); 
});

(Any chance to update your jQuery version and use the .on() method?)

Upvotes: 2

Related Questions