jquery UI datepicker无法动态插入输入
我正在动态地将输入字段添加到td
元素
$('.edit_text').live('click',function(){ $(this).html(''); $(this).children('input').focus(); if ($(this).attr('id')=='date'){ $(this).children('input').datepicker( "refresh");//"option", "dateFormat","yy-mm-dd"); } });
但如果td有id日期,则datepicker不会显示。 我在插入的输入字段上也有模糊function,这是一个问题吗?
$('.editing').live('blur',function(){ //did something });
好吧,下面是带有可编辑文本框的动态jquery date picker
,您可以相应地更新代码。
$(function(){ $('#thedate').datepicker({ dateFormat: 'dd-mm-yy', onSelect: function(dateText) { $('#dateContainer').text(dateText); console.log(dateText); } }); });
Shown Date : currentData