Is it posible to have jQuery UI autocomplete on a contenteditable div and datepicker working in harmony?
问题 In the forum post "How to make jquery autocomplete to work for a contenteditable DIV instead of just INPUT, TEXTAREA fields." we see how to get autocomplete working on a contenteditable div element, however combined with datepicker the datepicker simply does not populate the input field. As you can see in this jsFiddle demo: http://jsfiddle.net/xvnaA/ Anyone have any wise ideas on how to fix this? 回答1: Instead of just overriding $.fn.val you could redefine it like this: (function ($) { var