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
- $("#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?
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css">
- <script src="http://code.jquery.com/jquery-1.11.2.js"></script>
- <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"></script>
- <script>
- $( document ).on( "pagecreate", function() {
- $( "<input type='number' id='dynamic-slider-input' data-type='range' min='0' max='100' step='1' value='17'>" )
- .appendTo( "#dynamic-slider-form" )
- .slider()
- .textinput()
- });
- </script>
- </head>
- <body>
- <form id="dynamic-slider-form">
- </form>
- </body>
- </html>
Thanks!