title: jquery change content of page by clicking button on the second page
body: <p>I have 2 php files and one jquery file (2 php files include that jquery file). How to change content of 1 page by clicking button on the 2 page using jquery(without refreshing pages). for ex: on button click send div (2 page) to the div (1 page). OR maybe use 2 jquery files or any other techniques. code demonstration would be perfect. my code:
  <strong>ex2.php</strong></p>
  
  <pre><code>&lt;script src="ex2.js"&gt;&lt;/script&gt;
  &lt;title&gt;Ex2&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;button class="show"&gt; show &lt;/button&gt;
  &lt;div class="showdiv"&gt; show &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>ex3.php</strong></p>
  
  <pre><code>&lt;script src="ex2.js"&gt;&lt;/script&gt;
  &lt;title&gt;Ex3&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;button class="save"&gt; Save &lt;/button&gt;
  &lt;div class="savediv"&gt; Save &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>ex2.js</strong></p>
  
  <pre><code>$(document).ready(function(){
      $(".save").click(function() {
          $(".showdiv").after("&lt;p&gt;GGGGGGGG&lt;/p&gt;");
  
      });
      $(".show").click(function() {
          $(".showdiv").after("&lt;p&gt;BBBBBBBB&lt;/p&gt;");
          $(".savediv").after("&lt;p&gt;BBBBBBBB&lt;/p&gt;");
      });
  
  });
  </code></pre>