A lightweight and customizable jQuery plugin for creating autocomplete functionality with city names. This plugin provides an elegant way to add autocomplete features to input fields, perfect for location-based applications.
- Fast & Responsive: Minimal delay with efficient caching
- Customizable: Configurable delay, minimum characters, and display options
- Lightweight: Pure jQuery implementation with no heavy dependencies
- Easy Integration: Simple setup with existing forms
- Cross-browser Compatible: Works across all modern browsers
- Download the project files
- Include jQuery and the autocomplete plugin in your HTML:
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="jquery.autocomplete.js"></script>
<script src="func_auto_complete.js"></script><script src="https://cdn.jsdelivr.net/gh/hkevin01/JQuery-AutoComplete-Cities@master/jquery.autocomplete.js"></script><!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="jquery.autocomplete.js"></script>
</head>
<body>
<input type="text" id="city-input" placeholder="Enter city name...">
<script>
$("#city-input").autocomplete("autocomplete.php", {
delay: 10,
minChars: 2,
maxItemsToShow: 8,
autoFill: true
});
</script>
</body>
</html>$("#start").autocomplete("autocomplete.php", {
delay: 10, // Delay in milliseconds
zIndex: 9999, // Z-index for dropdown
minChars: 2, // Minimum characters to trigger
matchSubset: 1, // Match subsets
matchContains: 1, // Match contains
maxItemsToShow: 8, // Maximum items in dropdown
cacheLength: 10, // Cache length
autoFill: true // Auto-fill first match
});For detailed documentation, API reference, and advanced examples, visit our Documentation.
| Browser | Version |
|---|---|
| Chrome | ✅ Latest |
| Firefox | ✅ Latest |
| Safari | ✅ Latest |
| Edge | ✅ Latest |
| IE |
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Documentation: Project Wiki
- TypeScript definitions
- React wrapper component
- Vue.js plugin
- Angular directive
- ES6 module support
- CDN distribution
If you find this project useful, please consider giving it a star!
Made with ❤️ by hkevin01