Calling the destroy method does nothing for slider and control group

Calling the destroy method does nothing for slider and control group

I'm following the example with the dynamically injected slider control posted here and I have the HTML code below.

Now when I run

  1. $("#dynamic-slider-input).slider("destroy")

I expect the control to be destroyed, but it's still there. The same happens for the control group control, but not for the flipswitch control. Am I doing something wrong?


  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.  <meta charset="utf-8" />
  5.  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css">
  6.  <script src="http://code.jquery.com/jquery-1.11.2.js"></script>
  7.  <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"></script>
  8.  <script>
  9.  $( document ).on( "pagecreate", function() {
  10.      $( "<input type='number' id='dynamic-slider-input' data-type='range' min='0' max='100' step='1' value='17'>" )
  11.          .appendTo( "#dynamic-slider-form" )
  12.          .slider()
  13.          .textinput()
  14.  });
  15.  </script>
  16. </head>
  17. <body>
  18.  <form id="dynamic-slider-form">
  19.  </form>
  20. </body>
  21. </html>

Thanks!