title: Update JSON Data in JavaScript
body: <p>I have been working on creating dynamic accordion by getting json data. I have implemented it and it works as expected, the code is as follows:</p>
  
  <p>fiddle: <a href="http://jsfiddle.net/xg7cr0g4/68/" rel="nofollow">jsfiddle.net/xg7cr0g4/68/</a></p>
  
  <p>However, at this stage, I would like to edit accordion header (formationName) and once I click on the refresh button, it should update the json string. I couldn't figure out how to approach the problem.</p>
  
  <pre><code>   $("#refresh").click(function(){
      $( '.formationName' ).on( 'change', function(){
       var text=myData.offsetFormations[0].val();
       myData.offsetFormations[0]["formationName"]=text;
       json = JSON.stringify(jsonString);
       alert( jsonString );
      });
   });
  </code></pre>
  
  <p>By the way, I recently started on web development.</p>