ID Ends With in pure Javascript
<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 id 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>
