To attach a date picker to an input element, I’m using a date-picker plugin like so:
$('.foo').simpleDatePicker();
How would I attach this function to dynamically created $(‘.foo’)s, so that if I append another $(‘.foo’) element to the page, the simpleDatePicker function is already attached?
I would prefer to do it on document.ready instead of every time it is appended. Neither ‘live()’ nor ‘bind()’ seemed appropriate.
you can use .live for this using a late-binding technique.