title: onclick to update a html table
body: <p>I have created a variable in php which when clicked i would like it to populate another table which some data.</p>
  
  <p>I'm guessing i use AJAX and Jquery but what function do i look at?</p>
  
  <p>e.g.
  if i did something like this. I would like to click $variable1 and only when clicked appear in table1 in .</p>
  
  <p>Does anybody have a link to the function or the few lines of code that can do this? 
  Thanks</p>
  
  <pre><code>&lt;?php
  $variable1 = "text";
  echo $variable1;
  ?&gt;
  
  &lt;div id="table1"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;variable1 will go here when clicked&lt;/td&gt;
  </code></pre>