title: Javascript auto click button every 5 second
body: <p>I have a html button and i want use setInterval click functions every 5 second. Many times i try but my code not working for this. Please help.
  Button</p>
  
  <pre><code>&lt;a data-role="button" data-mini="true" class="id-buy-again green ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-up-c" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="c"&gt;&lt;span class="ui-btn-inner ui-btn-corner-all"&gt;&lt;span class="ui-btn-text"&gt;Tekrar Satın Al&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Click</p>
  
  <pre>
  setInterval(function() {
    document.getElementsByClassName("a.id-buy-again.green.ui-btn.ui-shadow.ui-btn-corner-all.ui-mini.ui-btn-up-c")[0].click();
  }, 5000);
  </pre>
  
  <p>Someone can help for this? :(</p>