title: How to store value in localstorage on button click using knockout js?
body: <p>This is my code but when i type text into input box after that i click on save button then text is saving into dropdown list but this text is't storing in local storage and for this i m using knockout.js</p>
  
  <pre><code> &lt;form style="margin-top: -25px;"&gt;
              &lt;button id="buttonSave" type="submit" style="margin-left: 1156px;"&gt;Save&lt;/button&gt;
  
           &lt;/form&gt;
  
      &lt;div id="labelList" class="btn-group" style="margin-top: -595px;margin-left: 3px;"&gt;
          &lt;input id="editExistannotation" data-bind="value: annotationList" class="editAnnotationList textArea" type="text" placeholder="Edit existing annotation"/&gt;
      &lt;select data-bind="options: area"&gt;&lt;/select&gt;
  
      &lt;/div&gt;
  
  ----------------------------------------------------
  
    var addHandle = function () {
                  this.items = ko.observableArray();
                  this.add = function (item) { this.items.push(item); }
                  this.remove = function (item) { this.items.remove(item); }
                  this.clear = function () { this.items.removeAll(); }
              }
              var addHandler = new addHandle();
              ko.applyBindings(addHandler, document.getElementById("slider"));
  
              $("#buttonSave").click(function () {
                  var label_object;
                  var labelText = document.getElementById("textarealabel");
                  var labelObject = new Object();
                  labelObject.textarealabel = labelText.value;
                  localStorage.setItem('label_object', JSON.stringify(labelObject));
                  $("#ddlList").prepend("&lt;option value='0'&gt;" + localStorage.getItem(label_object) + "&lt;/option&gt;");
                  return false;
              })
   var existAnnotationmodel = new function () {
  
                  var labelObject = $('#textarealabel').val();
                  this.annotationList = ko.observable();
                  this.area = ko.observableArray();
                  this.append = ko.computed(function () {
                      this.area.push(this.annotationList());
                      localStorage.setItem('labelObject', JSON.stringify(labelObject));
                  }, this);
              }
              ko.applyBindings(existAnnotationmodel);
  </code></pre>