Destroy and re-initialize a bootstrap-slider
问题 I am using the Bootstrap-slider found here - https://github.com/seiyria/bootstrap-slider and currently am using v10 (although I've tried with v11 as well but the same result). This is my code: /* For better styling - this uses Bootstrap slider */ $('.bs_sliders').each(function () { var id = '#' + $(this).attr('id'); if (typeof window[id] !== 'undefined') { window[id].slider('destroy'); delete window[id]; } // .on will only work with an ID based selector not class window[id] = $(id).slider({