title: Getting element by a custom attribute using JavaScript
body: <p>I have an XHTML page where each HTML element has a unique custom attribute, like this:</p>
  
  <pre><code>&lt;div class="logo" tokenid="14"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I need a way to find this element by ID, similar to <code>document.getElementById()</code>, but instead of using a general ID, I want to search for the element using my custom <code>"tokenid"</code> attribute. Something like this:</p>
  
  <pre><code>document.getElementByTokenId('14'); 
  </code></pre>
  
  <p>Is that possible? If yes - any hint would be greatly appreciated.</p>
  
  <p>Thanks.</p>