Reset the Value of a Select Box
<p>I'm trying to reset the value of two select fields, structured like this,</p>

<pre><code>&lt;select&gt;
  &lt;option&gt;&lt;/option&gt;
  &lt;option&gt;&lt;/option&gt;
  &lt;option&gt;&lt;/option&gt;
&lt;/select&gt;

&lt;select&gt;
  &lt;option&gt;&lt;/option&gt;
  &lt;option&gt;&lt;/option&gt;
  &lt;option&gt;&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>jQuery,</p>

<pre><code>$('select').each(function(idx, sel) {
  $(sel).find('option :eq(0)').attr('selected', true);
});
</code></pre>

<p>Unfortunately, no matter how many ways I try it, it just doesn't happen. Nothing in the console. I have no idea what's going on? I know there has to be a way to do this, you can do <strong>anything</strong> with JS</p>

<p>EDIT: </p>

<p>I figured out that the issue only occurs when I try to fire the code on the click of a dom element, however, I know that the code should be working, because when I have</p>

<pre><code>$('p').click(function(){
  console.log('test');
});
</code></pre>

<p>It outputs 'test' to the console, but when I include the code in this function, nothing happens. Why is this?</p>
