title: How do I change a single value inside a localStorage item?
body: <p>I'm trying to change a value inside localstorage. This item is the status of a checkbox. I want, everytime that a checkbox is checked to set the value to true or false of that checkbox. I tried many ways until I realized that there is no way you can change a value without using JSON.</p>
  
  <p>To add the value I use: </p>
  
  <pre><code>localStorage.setItem("status-" + i, $status.is(":checked"));
  </code></pre>
  
  <p>and to delete I use:</p>
  
  <pre><code>var parentId = $this.parent().attr('id');
  localStorage.removeItem("'" + parentId + "'");
  </code></pre>
  
  <p>Now to change the value I tried: </p>
  
  <pre><code>$itemList.delegate("#status-" + i, 'click', function(e) {
  
                  var $this = $(this);
                  var parentId = this.parent().attr('id');            
  
                  if ($this.is(":checked")) { 
  
                      localStorage.setItem("'" + parentId + "'".val("fdgsdagf"));
                      // Note that alert here works.
  
                  }
  });
  </code></pre>
  
  <p>This is how my local storage looks like:
  <img src="https://i.stack.imgur.com/cahYj.jpg" alt="">
  I hope someone could help me. I've been working on it for few days...</p>
  
  <p>Thanks alot</p>