Trying to reset all dropdowns except the one that was changed
<p>I have 4 dropdowns and when 1 is selected, I want the other 3 to reset to the first option in the dropdown. I have the code below and it doesn't work.</p>

<pre><code>$(document).ready(function() {

            $('select').change(function() {

                var current = $(this).attr('id');

                $('select').each(function() {

                    if(!$(this).attr('id') == current) {
                        $('select option:eq(0)').attr('selected', true);
                    }
                });
            }); 
        });
</code></pre>

<p>
            
            
        </p>

<pre><code>    &lt;h:selectOneMenu value="#{selectCategory.currentCategory}"
        valueChangeListener="#{selectCategory.valueChanged}" id="menu2"&gt;
        &lt;f:selectItems value="#{selectCategory.national}" /&gt;
        &lt;a4j:ajax event="valueChange" execute="@this"
            oncomplete="loadDataAndCreateChart()" /&gt;
    &lt;/h:selectOneMenu&gt;

    &lt;h:selectOneMenu value="#{selectCategory.currentCategory}"
        valueChangeListener="#{selectCategory.valueChanged}" id="menu3"&gt;
        &lt;f:selectItems value="#{selectCategory.industry}" /&gt;
        &lt;a4j:ajax event="valueChange" execute="@this"
            oncomplete="loadDataAndCreateChart()" /&gt;
    &lt;/h:selectOneMenu&gt;

    &lt;h:selectOneMenu value="#{selectCategory.currentCategory}"
        valueChangeListener="#{selectCategory.valueChanged}" id="menu4"&gt;
        &lt;f:selectItems value="#{selectCategory.mayo}" /&gt;
        &lt;a4j:ajax event="valueChange" execute="@this"
            oncomplete="loadDataAndCreateChart()" /&gt;
    &lt;/h:selectOneMenu&gt;
</code></pre>

<p>equals to</p>

<pre><code>&lt;select id="menu1" name="menu1" size="1" onchange="RichFaces.ajax(this,event,{&amp;quot;sourceId&amp;quot;:&amp;quot;menu1&amp;quot;,&amp;quot;parameters&amp;quot;:{&amp;quot;javax.faces.behavior.event&amp;quot;:&amp;quot;valueChange&amp;quot;} } )"&gt;  &lt;option value="1" selected="selected"&gt;1&lt;/option&gt;
    &lt;option value="2"&gt;2&lt;/option&gt;
    &lt;option value="3"&gt;3Grant&lt;/option&gt;

    &lt;option value="4"&gt;4&lt;/option&gt;
    &lt;option value="5"&gt;5&lt;/option&gt;
    &lt;option value="6"&gt;6&lt;/option&gt;
&lt;/select&gt;&lt;select id="menu2" name="menu2" size="1" onchange="RichFaces.ajax(this,event,{&amp;quot;sourceId&amp;quot;:&amp;quot;menu2&amp;quot;,&amp;quot;parameters&amp;quot;:{&amp;quot;javax.faces.behavior.event&amp;quot;:&amp;quot;valueChange&amp;quot;} } )"&gt; &lt;option value="1" selected="selected"&gt;1&lt;/option&gt;
    &lt;option value="2"&gt;2&lt;/option&gt;
    &lt;option value="3"&gt;3&lt;/option&gt;

&lt;/select&gt;&lt;select id="menu3" name="menu3" size="1" onchange="RichFaces.ajax(this,event,{&amp;quot;sourceId&amp;quot;:&amp;quot;menu3&amp;quot;,&amp;quot;parameters&amp;quot;:{&amp;quot;javax.faces.behavior.event&amp;quot;:&amp;quot;valueChange&amp;quot;} } )"&gt; &lt;option value="1" selected="selected"&gt;1&lt;/option&gt;
    &lt;option value="2"&gt;2&lt;/option&gt;
    &lt;option value="3"&gt;3&lt;/option&gt;
&lt;/select&gt;&lt;select id="menu4" name="menu4" size="1" onchange="RichFaces.ajax(this,event,{&amp;quot;sourceId&amp;quot;:&amp;quot;menu4&amp;quot;,&amp;quot;parameters&amp;quot;:{&amp;quot;javax.faces.behavior.event&amp;quot;:&amp;quot;valueChange&amp;quot;} } )"&gt; &lt;option value="1" selected="selected"&gt;1&lt;/option&gt;
    &lt;option value="2"&gt;2&lt;/option&gt;
    &lt;option value="3"&gt;3&lt;/option&gt;

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