title: ID Ends With in pure Javascript
body: <p>I am working in a Javascript library that brings in jQuery for one thing: an "ends with" selector.  It looks like this:</p>
  
  <pre><code>$('[id$=foo]')
  </code></pre>
  
  <p>It will find the elements in which the <code>id</code> ends with "foo".</p>
  
  <p>I am looking to do this without jQuery (straight JavaScript).  How might you go about this?  I'd also like it to be as efficient as reasonably possible.</p>