8.7w+
社区成员
$(function(){
$( "#key" ).autocomplete({
source: "search.php",
minLength: 2,
autoFocus: true
});
});
</script>
</head>
<body>
<div id="header">
</div>
<div id="main">
<p style="height:32px; line-height:32px; margin-top:40px; padding-left:200px">分别输入英文关键词</p>
<div id="demo">
<input type="text" id="key" name="key" />
</div>
</div>
$( "#key" ).autocomplete({
source: "search.php",
minLength: 2,
autoFocus: true,
select: function( event, ui ) {
var id = ui.item.value;
$('#key_id').val(id);
}
});