Q:

Loading user edits from local storage from multiple elements

I'm trying to load multiple saved elements as part of the local storage for the website planner I am making as part of when the website checks for existing saved elements when it initially loads. 
I cannot get this to work properly unfortunately, seemingly I can't load multiple elements all at once.  
Only one of them would be able to load, if I try loading two or more at a time it won't have the desired effect.  
<script>
    function checkEdits() {
        if(localStorage.userEdits!=null)
            document.getElementById("edit1").innerHTML = localStorage.userEdits;
    }   
</script>

This code works fine as I am only loading "edit1", but I also want to load "edit2" and "edit3" and so on. 
If I add "document.getElementById("edit2").innerHTML = localStorage.userEdits;" under the code to get "edit1" what is meant to appear on the planner for "edit2" is just the same as what is supposed to appear for "edit1" for some reason. 
Can this be fixed?  Thanks. 

A:

If I got your question right, I think your userEdits in localstorage is getting overwritten
 function saveEdits1() 
 { 
     var editElem = document.getElementById("edit1"); 
     var userVersion = editElem.innerHTML; 
     localStorage.userEdits1 = userVersion; 
 }

 function saveEdits2() 
 { 
     var editElem = document.getElementById("edit2"); 
     var userVersion = editElem.innerHTML; 
     localStorage.userEdits2 = userVersion; 
 }

function checkEdits() 
{
    if(localStorage.userEdits1!=null)
        document.getElementById("edit1").innerHTML = localStorage.userEdits1;
    if(localStorage.userEdits2!=null)
        document.getElementById("edit2").innerHTML = localStorage.userEdits2;
}   

Edit
You can even use a single array for all edit data:
 function saveEdits() 
 { 
     var editsToStore = [];
     var editElem, userVersion;
     for(i=0; i<NO_OF_FIELDS; i++) 
     {
         editElem = document.getElementById("edit"+(i+1)); 
         userVersion = editElem.innerHTML; 
         editsToStore.push(userVersion);
     }
     localStorage.setItem('edits', editsToStore);
 }

 function CheckEdits()
 {
     var editsOb = localstorage.edits;
     for(i=0; i<NO_OF_FIELDS; i++) 
     {
         document.getElementById("edit"+(i+1)).innerHTML = editsOb[i];              
     }
 }

