jQuery endsWith for attributes
<p>using jQuery, I'm trying to see if a random id ends with a certain string using the following pseudo code:</p>

<pre><code>var node = $('#foobar');

if (node.attr('id').endsWith('bar')) {
 // do stuff
}
</code></pre>

<p>I know for node selection you can go <code>$(id?='bar')</code> , but I need something that works for <code>$.attr()</code>.</p>

<p>Any ideas?</p>
