Reset functions after ajax <p>I have this javascript file: <a href="http://pastebin.com/m2keHsTM" rel="nofollow">http://pastebin.com/m2keHsTM</a></p> <p>A big part of it is a toggle switch that works by sliding your finger or mouse on it. As you see at the end of the document </p> <pre><code>var togglebox = "&lt;div class='toggle_box'&gt;&lt;/div&gt;"; $('input[type=checkbox]').css('display','none'); $('fieldset[data-input-type=checkbox]').append(togglebox); var mouseDown = false; var beginTouchDown = 0; create_elements(); set_listeners(); </code></pre> <p>replaces the checkboxes on the page by div's that are "slideable" This works great, only when I load another page trough ajax, other new checkboxes do not get replaced. Is there a way to reset those functions and make them check again after an ajax call?</p> <p>Thanks a lot for your help :)</p>