title: How to update values in local storage dynamically,on button click?
body: <p>This is my code used for adding values to local storage.</p>
  
  <pre><code>    var textval=0;
  function addValue(){
      console.log(typeof(localStorage.getItem(textval)));        
      textval= localStorage.length+1;
      var fieldValue = $('#textfield').val(); 
      localStorage.setItem(textval, fieldValue);
      textval = 0;
  }
  </code></pre>
  
  <p>now, If I want to edit the value in local storage,what to do for that?</p>
  
  <pre><code>My HTML code used for updation lies below:-
  &lt;input class="form-control" id="ex2" type="text" placeholder="Enter the key"&gt;&lt;br&gt;
  &lt;input class="form-control" id="ex21" type="text" placeholder="Enter the updated value"&gt;&lt;br&gt;
  &lt;button type="button" class="btn btn-primary"    onClick="editValue();"&gt;Enter&lt;/button&gt;
  </code></pre>
  
  <p>When I click Enter button after specifing the key and updated value in text box,those changes should reflect in my localstorage.What I have to do for that?
  Please help me.Thanks in advnace..</p>