Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 jquery-ui 自动完成文本框,我想为文本框设置默认文本,当文本框获得焦点时,我想删除它。
试试这个
$( ".selector" ).autocomplete({ focus: function(event, ui) { $(".selector").val('');} })
我设法解决了它:
我破坏使用焦点事件的唯一方法是这样的:
$("SELECTOR").autocomplete({ .... }).focus( function(event, ui) { ...... });