Applying and changing the classname of selected radio with scripting
<p>I have a form that has a radio button set.  When the page loads, I want use some simple scripting that immediately apply a classname to the label of the corresponding input and when the user click on another radio button in the set to remove that class and apply the classname to the newly selected radio button label.</p>

<p>Any ideas how this can be done?</p>

<p>JSFiddle: <a href="http://jsfiddle.net/eYDV4/" rel="nofollow">http://jsfiddle.net/eYDV4/</a></p>

<pre><code>&lt;form id="myForm" action="" method="post"&gt;
   &lt;input type="radio" id="radio1" name="myRadio" value="radio1"&gt;
   &lt;label for="radio1"&gt;radio1&lt;/label&gt;
   &lt;input type="radio" id="radio2" name="myRadio" value="radio2"&gt;
   &lt;label for="radio2"&gt;radio2&lt;/label&gt;
   &lt;input type="radio" id="radio3" name="myRadio" value="radio3" checked="checked"&gt;
   &lt;label for="radio3"&gt;radio3&lt;/label&gt;
   &lt;input type="radio" id="radio4" name="myRadio" value="radio4"&gt;
   &lt;label for="radio4"&gt;radio4&lt;/label&gt;
&lt;/form&gt;
</code></pre>
