jQuery: Radio .change function, strange bug
<p>I am trying to get the value of a selected radio after the .change event is triggered. I need to use an external function to do so but I cannot seem to get the correct value.</p>

<p>HTML:</p>

<pre><code>&lt;input type="radio" name="myradio" value="1.0"&gt; 1.0
&lt;input type="radio" name="myradio" value="2.0"&gt; 2.0
</code></pre>

<p>jQuery:</p>

<pre><code>$("input[type='radio'][name='myradio']").change(function() {

    //SHOWING GOOD VALUE
    radio_value = parseFloat($(this).val());
    alert(radio_value);

    TEST();

}

function TEST(){

    //SHOWING WRONG VALUE
    radio_value = parseFloat($("input[type='radio'][name='myradio']:checked").val());
    alert(radio_value); 

}
</code></pre>

<p>For example, if I click the radio 1.0 is checked and I click the radio 2.0, the above jquery code will output 2.0 for the first alert and 1.0 for the second. The TEST() function output the old value, it seems like if the radio event has not happened yet.</p>

<p>I need to find a way to get the good radio value in the TEST() function without transferring any parameter to it.</p>

<p>How can I do such thing?</p>
