@nhangg/locationselector
v1.0.1
Published
A lightweight and easy-to-use package for dynamically rendering Province, District, and Ward dropdowns. With seamless API integration and flexible customization, it simplifies location-based form creation for any project. Perfect for e-commerce, administr
Downloads
123
Readme
LocationSelector
A JavaScript class for rendering provinces, districts, and wards with data fetched from an API.
Installation
You can install the package using npm:
npm install @nhangg/locationselector
import LocationSelector from '@nhangg/locationselector';
const locationSelector = new LocationSelector(
'https://api.example.com', // API base URL
'#province', // Province select element
'#district', // District select element
'#ward' // Ward select element
);