Search Results

Search found 1 results on 1 pages for 'user1755603'.

Page 1/1 | 1 

  • JavaScript loop stops on "localStorage.removeItem"

    - by user1755603
    Why is the "localStorage.removeItem" stopping the loop? If I remove "localStorage.removeItem" and only leave the "alert", it loops though whole thing, but with "localStorage.removeItem" it stops on the first match. function removeTask() { for (i=0; i < localStorage.length; i++){ checkbox = document.getElementById('utford'+i); if (checkbox.checked == true) { alert(i); localStorage.removeItem(localStorage.key(i)); } } printList(); }

    Read the article

1