I need that every text input in a given class is a datepicker. Something like:
$("input[type=text].time").datepicker();
but I'm adding a lot of code via Jquery.load() so I believe I need a delegate. The problem is I don't know how to do it, because as far as I know, load event cannot be used in a delegate. It will be easy if it exists:
$(document).delegate("input[type=text].time", "load", function(){
$(this).datepicker();
});
$("body").delegate("input[type=text].time", "focusin", function(){
$(this).datepicker();
});
I used delegate on the body because I don't know if you have your code in other containers that you can target.
Here is a fiddle that targets a specific div
with delegate:
http://jsfiddle.net/MpqAy/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With