如何为标签字段创建一个自动完成文本字段,就像 Stack Overflow 上的那个一样?我想将它用于我的 Rails 应用程序。
最佳答案
StackOverflow 使用 jQuery Autocomplete Plugin , 它支持多项。
检查 demos .
编辑页面的片段:
$("#tagnames").autocomplete("/tags/filter", {
max: 6,
highlightItem: true,
multiple: true,
multipleSeparator: " ",
matchContains: true,
scroll: true,
scrollHeight: 300
});
关于javascript - 自动完成文本字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/684431/