How to bind AJAX loaded elements to JQuery plugins with on() function <p>I am using a JQuery plugin datepicker that allows me to set options e.g. default date, format, minimum date etc. </p> <p><strong>Here is the code</strong></p> <pre><code>$(".standardDatePicker").datepicker({ defaultDate: "+1w", dateFormat: 'dd/mm/yy', changeMonth: true, numberOfMonths: 1, minDate: new Date(_currentTime.getFullYear(), _currentTime.getMonth(), _currentTime.getDate(), 1) }); </code></pre> <p>I am loading content via Ajax into a modal, but am then trying to bind those elements that have been inserted into the DOM with a call to the datepicker plugin. </p> <p>The following code has worked fine on other code but i cant find a way to use it with plugins, is this even possible without modifying the plugin?</p> <p><strong>What I have tried</strong></p> <pre><code>$("document.standardDatePicker").on(datepicker({ defaultDate: "+1w", dateFormat: 'dd/mm/yy', changeMonth: true, numberOfMonths: 1, minDate: new Date(_currentTime.getFullYear(), _currentTime.getMonth(), _currentTime.getDate(), 1) })); </code></pre>