I\'m trying to remove the individual items from the localStorage. I\'m using localStorage for storing selected list items in the listview. I attached the checkboxes for remo
I think the problem is in this part:
$("#delete").on('click', function() {
var checked = $('#add #check:checkbox:checked');
var url = localStorage.key(checked);
localStorage.removeItem(url);
$("#favoritesList").listview('refresh');
});
you are not using correct key for deleting and its because you are using :
var url = localStorage.key(checked);
and checked==[Object]==1
so you are pointing to localStorage.key(1)
for solving this problem you can both use key=localStorage.key(some);localStorage.removeItem(key);
and localStorage.removeItem(some);
but the important part is that you should match 'an index(first way)' or a 'key value(the second way)' for each checkbox and I can help you if I have the complete code (I think still there are some part of HTML or codes that are related)(also it would be so good if you put a fiddle of your codes)