title: Tampermonkey clicking a button by class
body: <p>So i have a school issue where i need to access a site but this site requires me to go through around 4 portals to get there and am hoping to just write a quick script to do this for me. Problem comes where the site is very sloppy and are written with names being the same on certian buttons so I would like to click the buttons based on class</p>
  
  <p>the classes are readit2, readit23, readit239, and readit2394</p>
  
  <pre><code> $(function(){
          document.getElementByClassName(readit2).click();
         });
  </code></pre>
  
  <p>the above code i thought would click it as soon as it loads the first page but does not. any help would be great</p>
  
  <pre><code>// ==UserScript==
  // @name       dumb spider web
  // @namespace  ===============
  // @version    0.1
  // @description  gets me through this dumb stuff
  // @match      ===============
  // @copyright  2012+, You
  // @require http://code.jquery.com/jquery-latest.js
  // ==/UserScript==
  </code></pre>
  
  <p>edit ^ added the header stuff</p>
  
  <p>more edits:</p>
  
  <p>it works through the console now but through tamper monkey OR grease monkey I can not get it to actually preform the action.</p>
  
  <pre><code>$(function(){
      document.getElementsByClassName("readit2")[0].click();
  });
  </code></pre>
  
  <p>Works through console but does not run when script is started.</p>