title: document.getElementsByName doesn't work for me?
body: <p>I'm making a script in tampermonkey, that clicks on an element automatically.
  The element I try to click is made like this when I inspect it in chrome:</p>
  
  <pre><code>&lt;span id="result_5_name" class="market_listing_item_name" style="color: #FFD700;"&gt;Item | Anodized Navy&lt;/span&gt;
  </code></pre>
  
  <p>¨</p>
  
  <p>The script I tried to make goes like this:</p>
  
  <pre><code>function detectandclick {
      var item = document.getElementsByName('Item | Anodized Navy');
  
      item[0].click();
  }
  </code></pre>
  
  <p>I'm new to programming, so there's probably something really wrong here.</p>
  
  <p>PS: I do not want to use the getElementsById or class, I need to get the element by it's name displayed on the webpage.</p>
  
  <p>Thanks for helping!</p>