title: Javascript Click on Element by Class
body: <p>So I am writing a script that can be run on a page but I want to click on this element, unfortunately, it does not have an <code>id</code> to get and I am trying to use the <code>.click()</code> function on it, but it doesn't work, here's what I have, anyone know how to fix it? This is the only element in the class also</p>
  
  <pre><code>var classes = document.getElementsByClassName('rateRecipe btns-one-small');
  var Rate = classes[0];
  Rate.click();
  </code></pre>