
有很多的jquery位可以做到这一点,您可以在Google上搜索“ jquery autocomplete”,然后看看最喜欢哪个。
这是比较有名的一个:http :
//docs.jquery.com/Plugins/AutoComplete
<script> var emails = [ { name: "Kitty Sanchez", to: "kanchez@bluth.com" }, { name: "Lucille Austero", to: "lucille2@balboatowers.net" }, { name: "Bob Loblaw", to: "bloblaw@bobloblawlawblog.com" }, { name: "Sally Sitwell", to: "sally@sitwell.org" } ]; $(document).ready(function(){ $("#Recipients").autocomplete(emails, { multiple: true, minChars: 1, matchContains: "word", autoFill: false, formatItem: function(row, i, max) { return """ + row.name + "" <" + row.to + ">"; }, formatMatch: function(row) { return row.name + " " + row.to; }, formatResult: function(row, i, max) { return """ + row.name + "" <" + row.to + ">"; } }); });</script>欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)