jquery AutoComplete插件自动提示

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<title>jQuery Autocomplete Plugin</title>
<script type="text/javascript" src="../lib/jquery.js"></script>
<script type='text/javascript' src='../jquery.autocomplete.js'></script>
<script type='text/javascript' src='localdata.js'></script>
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="../jquery.autocomplete.css" />

	
<script type="text/javascript">
$().ready(function() {	
	$("#suggest1").focus().autocomplete(cities);
	$("#clear").click(function() {
		$(":input").unautocomplete();
	});
});
</script>	
</head>
<body>
<div id="content">	
	<form autocomplete="off">
		<p>
			<label>Single City (local):</label>
			<input type="text" id="suggest1" />
			<button id="clear">Remove all autocompletes</button>
		</p>		
</body>
</html>

相关推荐