I have a list that I am adding items to dynamically with the below code.
var expenses=JSON.parse(localStorage.getItem("expenseDetails"));
li.empty();
for (var i = 0; i < expenses.length; i++) {
if(expenses.jobID==jno){
var litext=expenses.type + '-' +expenses.description +' $'+ expenses.value;
newexp="" + litext +"";
li.append(newexp).listview('refresh');
}
}
The id of each item I want to be the expense id so when I click on it I know which one it is. However the id is not being picked up and instead the id being returned is something like mobilelistitem_258_2.
The code on click event on the list item is
var eno=$(this).closest("li").attr('id');
How do I return my id?