<link href="/Content/site.css" rel="stylesheet"/>
<script src="/Scripts/modernizr-2.5.3.js"></script>
<script src="/Scripts/jquery-1.7.1.js"></script>
<script>
var availableTagsbase = ["qq.com", "163.com", "126.com", "sohu.com", "sina.com", "gmail.com", "21cn.com", "hotmail.com", "vip.qq.com", "yeah.net"]; var availableTagsnew = ["qq.com", "163.com", "126.com", "sohu.com", "sina.com", "gmail.com", "21cn.com", "hotmail.com", "vip.qq.com", "yeah.net"]; $(function () { $("#Email").autocomplete({ source: availableTagsnew }); });
</script>
<input id="Email" onkeyup="fun2()" value="bing123@qq.com" type="text" style=" 328px; border: 1px solid #488ee7; color: #666; height: 16px; font-size: 14px; margin: 10px 10px 10px 0px; padding: 10px" />
效果如上。
谷歌搜索 关键字 : autocomplete http://jqueryui.com/autocomplete/