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.
我在单个页面上有 5 个 jquery 组合框,当用户单击它时,我想从组合框中删除文本。这应该只从选定的组合框中删除文本。
我使用以下代码将下拉列表转换为 jquery 组合框
$(function() { $( "select" ).combobox(); });
我认为更好的可能是
$("select").focus( function(){ $(this).val(""); } );
因为它也应该与 [TAB] 键一起使用......
我是正确的?
尝试这个
$("select").focus( function(){ $(this).html(""); });