Using jQuery, what's the best way to automatically initialize a plugin for all current and future elements of a particular class?
For example, I want all <input type="text" class="datepicker" /> have a jQuery UI <input type="text" class="datepicker" /> plugin, including everything that I could create at runtime.
Essentially, I want to do something like this:
$('.datepicker').live('create', function() { $(this).datepicker(); });
But, of course, there is no creation event that I can use.
javascript jquery jquery-ui
Chris fulstow
source share