Defines the initial value of province <select>. If it is a valid province, it will be selected. If not, it will be used as a placeholder.
city
Type: String
Default: —— 市 ——
Defines the initial value of city <select>. If it is a valid city under the selected province, it will be selected. If not, it will be used as a placeholder.
district
Type: String
Default: —— 区 ——
Defines the initial value of district <select>. If it is a valid district under the selected city, it will be selected. If not, it will be used as a placeholder.
⬆ back to top
Methods
getDistricts([districtCode])
districtCode (optional):
Type: Number
The district code of target country, province or city.
Destroy the distpicker instance, but keep the selected districts.
If you want to remove the selected districts, you can call reset method first and then call this method.
⬆ back to top
No conflict
If you have to use other plugin with the same namespace, just call the $.fn.distpicker.noConflict method to revert to it.
<scriptsrc="other-plugin.js"></script>
<scriptsrc="distpicker.js"></script>
<script>$.fn.distpicker.noConflict();// Code that uses other plugin's "$().distpicker" can follow here.</script>
Browser support
Chrome (latest)
Firefox (latest)
Safari (latest)
Opera (latest)
Edge (latest)
Internet Explorer 9+
As a jQuery plugin, you also need to see the jQuery Browser Support.