// 默认样式
<div id="distpicker">
<select></select>
<select></select>
<select></select>
</div>
我只用了省市

<script th:src="@{js/lib/jquery-2.2.3.min.js}" src="/static/js/lib/jquery-2.2.3.min.js"></script>
<script th:src="@{js/lib/dist/distpicker.min.js}" src="/static/js/lib/dist/distpicker.js"></script>
<script>
$(function () {
$('#select_city').distpicker('destroy');//销毁实例
$("#select_city").distpicker({
province: "湖北省",
city: "武汉市",
district: "洪山区",
autoSelect: true,
placeholder: false,
});
})
</script>
详细解释
GitHub网址
jQuery中国省市区地址三级联动插件Distpicker(中文)

网友评论