Using jQuery to set multiple selects using each
<p>I have a page full of selects, and they all have a common class.  I need to set every one of them to their first option.  Easy, right?  But what I finally wound up getting to work feels like such a hack... is there a better way?</p>

<pre><code>$('.myclass').each(function() {
    var firstOptSelector = '#' + $(this).attr('id') + ' option:first'; // HACK
    $(firstOptSelector).attr('selected','selected');
});
</code></pre>
