jquery 怎么实现自动填充···求解···
jquery 怎么实现自动填充···求解···最后给个源码···
这是我做的···
<html>
<head>
<script src="jquery.js"></script>
<script src="jquery.autocomplete.js"></script>
<link rel="stylesheet" href="jquery.autocomplete.css">
<script>
$(function() {
var array=new Array();
array.push({label: 'aaa', value: '中医' ,id:"1"});
array.push({label: 'aab', value: '国医堂',id:"2" });
$( "#tags" ).autocomplete(array
);
</script>
</head>
<body>
<div class="ui-widget">
aa<input id="tags" />
</div>
</body>
</html>
------解决方案--------------------
jquery Ui有自带的autocomplete组件哦
JScript code
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
------解决方案--------------------
lz是要自己实现?
------解决方案--------------------