title: How to set onclick repeat automatically? or it auto repeat functions?
body: <p>The situation now is:</p>
  
  <p>I have a button,when it is clicked, it sends its id to php page,then,clean the table and print a new table append to the column.</p>
  
  <p>The problem i am now facing is that,i would like to automatically update the table for every 30 seconds after the button is clicked,but not manually click it again myself. I have tried setTimeOut but it stopped showing table instead of updating it every time interval.</p>
  
  <p>my HTML button:</p>
  
  <pre><code>&lt;button type="button" onclick="ETArequest(this) " id="d1stop" class="list-group-item" style="text-align:center; height:30px; font-size:15px;"&gt;&lt;/button&gt;
  </code></pre>
  
  <p>my JavaScript:</p>
  
  <pre><code>function ETArequest(button) {
   if (button == "") {
      $('#ETAcol').empty();
      return;
  } else { 
      if (window.XMLHttpRequest) {
          // code for IE7+, Firefox, Chrome, Opera, Safari
          xmlhttp = new XMLHttpRequest();
      } else {
          // code for IE6, IE5
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      xmlhttp.onreadystatechange = function() {
          if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) {
              $('#ETAcol').empty();
              $('#ETAcol').append(xmlhttp.responseText);
          }
      };
  
      xmlhttp.open("GET","getTime.php?q="+(button.id),true);
      xmlhttp.send();
  
  }}
  </code></pre>