title: How to save JSON data locally (on the machine)?
body: <p>I am using the following link to create a tree like structure:
  <a href="http://www.jeasyui.com/demo/main/index.php?plugin=Tree&amp;theme=default&amp;dir=ltr&amp;pitem=#" rel="noreferrer">LINK</a></p>
  
  <p>This is my code :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Tree Context Menu - jQuery EasyUI Demo&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="themes/default/easyui.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="themes/icon.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="demo.css"&gt;
      &lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="jquery.easyui.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h2&gt;Tree Context Menu and Drag Drop Tree Nodes&lt;/h2&gt;
      &lt;p&gt;Right click on a node to display context menu.&lt;/p&gt;
      &lt;p&gt;Press mouse down and drag a node to another position.&lt;/p&gt;
      &lt;div style="margin:20px 0;"&gt;&lt;/div&gt;
      &lt;div class="easyui-panel" style="padding:5px"&gt;
          &lt;ul id="tt" class="easyui-tree" data-options="
                  url: 'tree_data1.json',
                  method: 'get',
                  animate: true,
                  dnd:true,
                  onContextMenu: function(e,node){
                      e.preventDefault();
                      $(this).tree('select',node.target);
                      $('#mm').menu('show',{
                          left: e.pageX,
                          top: e.pageY
                      });
                  }
              "&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div style="padding:5px 0;"&gt;
          &lt;a href="#" class="easyui-linkbutton" onclick="save()" data-options="iconCls:'icon-save'"&gt;Save&lt;/a&gt;
      &lt;/div&gt;
      &lt;div id="mm" class="easyui-menu" style="width:120px;"&gt;
          &lt;div onclick="append()" data-options="iconCls:'icon-add'"&gt;Append&lt;/div&gt;
          &lt;div onclick="removeit()" data-options="iconCls:'icon-remove'"&gt;Remove&lt;/div&gt;
          &lt;div class="menu-sep"&gt;&lt;/div&gt;
          &lt;div onclick="expand()"&gt;Expand&lt;/div&gt;
          &lt;div onclick="collapse()"&gt;Collapse&lt;/div&gt;
      &lt;/div&gt;
      &lt;script type="text/javascript"&gt;
          function append(){
              var t = $('#tt');
              var node = t.tree('getSelected');
              t.tree('append', {
                  parent: (node?node.target:null),
                  data: [{
                      text: 'new item1'
                  },{
                      text: 'new item2'
                  }]
              });
          }
          function removeit(){
              var node = $('#tt').tree('getSelected');
              $('#tt').tree('remove', node.target);
          }
          function collapse(){
              var node = $('#tt').tree('getSelected');
              $('#tt').tree('collapse',node.target);
          }
          function expand(){
              var node = $('#tt').tree('getSelected');
              $('#tt').tree('expand',node.target);
          }
      function save(){
              var a = document.createElement('a');
          a.setAttribute('href','data:text/plain;charset=utf-u,'+encodeURIComponent(JSON.stringify({$('#tt').html()}));
          a.setAttribute('download', "data.json");
  
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I am running this, nothing is getting saved.</p>
  
  <p>I have added a save button to this structure's code.</p>
  
  <p>I want that whenever the user clicks this save button then he could store this tree structure produced as JSON data on his/her local machine. I want this as this tree is editable. How can I do this? </p>
  
  <p>I used the following link for the same:</p>
  
  <p><a href="http://jsfiddle.net/mWuHe/14/" rel="noreferrer">link</a></p>
  
  <p>I want that whatever changes that happens to the id = "tt" could be retrieved in the form of JSON and store on my local machine. </p>