title: How to Click a Button by Name in Browser Console
body: <p>I am trying to click a button on a web page using the developer tools console in Google Chrome.</p>
  
  <p>The HTML for the button is:</p>
  
  <pre><code>&lt;input value="Send an Email" class="btn" name="email" onclick="navigateToUrl('/_ui/core/email/author/EmailAuthor?p2_lkid=00QU0000008xZYi&amp;amp;rtype=00Q&amp;amp;retURL=%2F00QU0000008xZYi','RELATED_LIST','email');" title="Send an Email" type="button"&gt;
  </code></pre>
  
  <p>As you can see, the button does not have an <code>id</code> attribute, so I'm trying to select it using the <code>name</code> attribute. My JavaScript code is:</p>
  
  <pre><code>document.getElementsByName("email").click()
  </code></pre>
  
  <p>What am I doing wrong?</p>