title: html to json get div data
body: <p>I want to convert html page div tag to json data and append that div in another html page.get that div that using id.</p>
  
  <p>suppose there is page.html in which div tags are there, having id page1 page2 and so on.Convert those to json data and get the div tags according to their id, then append those div tags to page2.html div tag. how to do that.</p>
  
  <p>this is page2.html</p>
  
  <pre><code>&lt;div id="page1"&gt;
  this is page1
  
  &lt;/div&gt;
  
  &lt;div id="page2"&gt;
  this is page1
  &lt;/div&gt;
  
  &lt;div id="page3"&gt;
  this is page1
  &lt;/div&gt;
  
  &lt;div id="page4"&gt;
  this is page1
  &lt;/div&gt;
  </code></pre>
  
  <p>having div tags</p>
  
  <p>I tried getting div using js but from another page
  this is page1.html and want to access div of page2.html</p>
  
  <pre><code>function getdata()
          {
              $.get('page2.html', null, function(text){
                    alert($(text).find('#page1'));
                  });
              var json = JSON.stringify(element);
              alert(json);
          }
  </code></pre>
  
  <p>I tried this but its not working.</p>