change div text on radion button click
<p>I want to put the radio button value in the status div. The text of status div should change, according to the radio button selected by the user.
The code that I used bellow is not working. Please help. Thanks!</p>

<p>HTML code:  </p>

<pre><code> &lt;form action=""&gt;
     &lt;input type="radio" name="sex" value="male"&gt;Male&lt;br&gt;
     &lt;input type="radio" name="sex" value="female"&gt;Female&lt;br&gt;
     &lt;div id="status"&gt;&lt;/div&gt;
  &lt;/form&gt;​
</code></pre>

<p>JS code: </p>

<pre><code> $(document).ready(function () {
    RadioStatus="";

    $("input[type='radio']:checked").each( function()
    { 
        if ($(this).attr('checked');)
              RadioStatus=$(this).val();
              $("#status").text(RadioStatus);
        });

    $("input[type='radio']").change(function()  
     {
             RadioStatus= $('input[type='radio']:checked').val()
            $('#status').text(RadioStatus);        
    });
});
</code></pre>
