我试图让 jQuery UI 自动完成搜索只搜索我的字符串的前几个字母。我想我可以用 jQuery UI 做一个键/值的事情,但我不确定这是否适用。
我有以下字符串:
AGREE Agreement by and between BLANK, in BLANK, of the county records.
只AGREE
应搜索,而不是字符串的其余部分。 AGREE
是用户将搜索的文本代码。
这是我的简单代码:
var availableTags = [
"AGREE Agreement by and between BLANK, in BLANK, of the county records.",
"CONDO Covenants, conditions, restrictions, reservations, terms, provisions, easements, liens for assessments, options, powers of attorney and limitations on title as set forth in the Ohio Revised Code Chapter 5311, or as set forth in the Declaration of Condominium ownership and Bylaws as recorded in BLANK, as amended, plat BLANK, of the county records."
];
$( "#tags" ).autocomplete({
source: availableTags
});
只有第一个单词AGREE
和CONDO
应该被搜索,而不是其余的字符串。这可能/可行吗?