IE and replaceWith not preserving radio button state

IE and replaceWith not preserving radio button state

Hello,

I've run into an issue regarding replaceWith not maintaining the state of a moved radio button input. I've prepared a simple example illustrating this issue. This works in FF and Chrome, but not IE.

Is there a way around this?

Thanks,
Colin


code:
  1. <html>
  2. <head>
  3. <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  4. <title>IE replaceWith issue</title>
  5. <script type='text/javascript'>
  6. $(function(){
  7.   $('a').click(function(e) {
  8.     e.preventDefault();
  9.     $('#temp').replaceWith($('#window').children());
  10.   });
  11. });
  12. </script>
  13. </head>
  14. <body>
  15.   <a href='#'>run replaceWith</a>
  16.   <p>Select a radio button and then click "run replaceWith". The value persists in FF, but not IE.</p>
  17.   <div id='window' style='background-color: #DDD; height: 100px;'>
  18.     <input id="id_received_date-days_0" type="radio" name="received_date-days" value="30" />
  19.     <input id="id_received_date-days_1" type="radio" name="received_date-days" value="50" />
  20.     <input type='text' name='test-test' />
  21.   </div>
  22.   <br />
  23.   <form id='foo' style='background-color: #EEE'>
  24.     <div id='temp'></div>
  25.   </form>
  26. </body>
  27. </html>