如果标题措辞奇怪,我提前道歉!
我想在客户端的列表(即朋友列表)上进行类似ajax的搜索。列表看起来像这样:
var friendList = new Array [
{
name: "Mark",
email: "mark@gmail.com",
birthDate: "01/01/1980"
},
{
name: "Steve",
email: "steve@gmail.com",
birthdate: "02/02/1980"
},
{
name: "Frank",
email: "frank@gmail.com",
birthDate: "03/03/1980"
}
]
我如何逐字母地搜索输入字段,如下所示:
<input type="search" id="searchFriends" />
谢谢!