Remove selected option with parentsUntil
<p>I may be going about this the wrong way. I have a container of links and form options. When clicking on links it selects an option. In order to deselect the option if another is selected I need to iterate up the parent elements until a specific class and then remove the selected value for that option. </p>

<p>Here is some of the HTML.</p>

<pre><code>&lt;ul class="cssClass"&gt;
  &lt;li&gt;&lt;div class="first-elem"&gt;Select&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="#firstValue"&gt;First Value&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#secondValue"&gt;Second Value&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;select name="someSelect"&gt;
        &lt;option value=""&gt;Select&lt;/option&gt;
        &lt;option value="firstValue"&gt;First Value&lt;/option&gt;
        &lt;option value="secondValue"&gt;Second Value&lt;/option&gt;
    &lt;/select&gt; 
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Here is the start of the jQuery. Everything is working except my removeAttr part so I have excluded the rest. </p>

<pre><code>$(".cssClass li a").click(function(e) {
  e.preventDefault();
    $(this).parentsUntil('.cssClass','option').removeAttr("selected");
</code></pre>

<p>But this is not working. Is there another way to do this?</p>
