select the option with the highest data-sale attribute : <p>kind a new to jquery and cant get my head around on this one. any help would be much appreciate.</p>

<p>add checked attribute to the radio input with the highest data-attribute. </p>

<p><strong>But</strong> :</p>

<p><strong>A</strong>. if the radio input in the bottom of the list has an attribute disabled="disabled" select the second highest option.</p>

<p>e.g.</p>

<pre><code>&lt;ul class="sales"&gt;
&lt;li&gt;&lt;input type="radio" data-sale="20"/&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="radio" data-sale="50"/&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="radio" data-sale="55"/&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="radio" checked="checked" data-sale="60"/&gt;&lt;/li&gt;&lt;!--add checked attribute--&gt;
&lt;li&gt;&lt;input type="radio" disabled="disabled" data-sale="90"/&gt;&lt;/li&gt;
</code></pre>

<p>  </p>

<p><strong>B</strong>. if the disabled attribute is not in the bottom of the list, still checked the highest radio.</p>

<p>e.g.</p>

<pre><code>&lt;ul class="sales"&gt;
&lt;li&gt;&lt;input type="radio" data-sale="20"/&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="radio" data-sale="50"/&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="radio" disabled="disabled" data-sale="55"/&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="radio" data-sale="60"/&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="radio" checked="checked" data-sale="90"/&gt;&lt;/li&gt;&lt;!--add checked attribute--&gt;
</code></pre>

<p>  </p>

<p>naturally the html apply the checked in the very first radio in the list. in this case the data-sale = 20</p>

<p>i have to append that data-sale attribute to a container span.</p>

<p>thanks appreciate your help.</p>
