title: How to push a button with javascript loop
body: <p>I am searching for a way with javascript to run a code to the console of chrome and push all the buttons with the same CLASS name of a website </p>
  
  <p>the code of the button is this</p>
  
  <pre><code>&lt;span&gt;&lt;a class="UFILikeLink" href="#" role="button" aria-live="polite" title="Like this" data-ft="{&amp;quot;tn&amp;quot;:&amp;quot;&gt;&amp;quot;}" data-reactid=".3k"&gt;
    &lt;i class="UFILikeLinkIcon img sp_j2jvp3kCzmm sx_751c68" data-reactid=".3k.0"&gt;&lt;/i&gt;
    &lt;span data-reactid=".3k.1"&gt;Like&lt;/span&gt;
  &lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>I have tried this code here</p>
  
  <pre><code>var el = document.getElementsByClassName('UFILikeLink'); 
  
  for (var i=0;i&lt;el.length; i++) {
      el[i].click();
  }
  </code></pre>
  
  <p>Sorry my mistake.</p>
  
  <p>The code is working but if I run the code for the second time it pushes again the button and it's like before.</p>
  
  <p>The thing is that I want to make it like, if the button is pushed once
  it will not be pushed again.</p>
  
  <p>Again sorry for the mistake.</p>
  
  <p>If I push the button then the code of the webpage changes to this</p>
  
  <pre><code>&lt;span&gt;&lt;a class="UFILikeLink UFILinkBright" href="#" role="button" aria-live="polite" title="Unlike this" data-ft="{&amp;quot;tn&amp;quot;:&amp;quot;?&amp;quot;}" data-reactid=".sk"&gt;
    &lt;i class="UFILikeLinkIcon img sp_j2jvp3kCzmm sx_c04d59" data-reactid=".sk.0"&gt;&lt;/i&gt;
    &lt;span data-reactid=".sk.1"&gt;Like&lt;/span&gt;
  &lt;/a&gt;&lt;/span&gt;
  </code></pre>