我正在使用 twitter bootstrap 字体。
$(document).ready(function() {
$("#searchfield").typeahead({
minLength: 3,
source: ["type1", "type2", "dtype3", "dtype4"]
});
});
input
当我专注于标签(“#searchfield”)时,即使它是空的,我也想在下拉菜单(建议下拉菜单)中显示所有内容。这意味着我希望在我没有输入任何字母时显示所有来源。如果我输入任何字母,它需要显示相关数据(打字头的正常功能。)
或者
点击某个链接。下拉菜单需要提供所有给定的来源。例子:
<a href="#someId">Click here to populate typehead in #searchfield input tag </a>
<input type="text" id="searchfield">
单击链接时,输入字段需要使用所有给定的源(type1, type2, dtype3,dtype4
)填充下拉列表