如何將datepicker附加到動態注入元素?附加jquery datepicker注入元素
我不能簡單地做一樣的東西:
$(function(){
$('.date').datepicker();
})
因爲DOM加載完成後,有帶班「.date」
我不認爲live()
也將在這裏工作
我的螢火這個錯誤$(".date").datepicker is not a function
編輯:
這是元素如何被注入
$('#typeId').change(function(){
$(this).nextAll().remove();
$(this).parent().append('<input type="hidden" name ="view_type" value="by_range"> <span>Start:</span> <input type="text" name="start_date" class="date"> <span>End:</span> <input type="text" name="end_date" class="date"> <input type="submit" value="Submit">');
})
做ü要動態更新日期? – 2011-02-28 14:40:39
@Mohan no i dont ... – slier 2011-02-28 14:55:40