省市联动功能的实现(jQuery Distpicker插件)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>省市联动</title>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/distpicker/2.0.5/distpicker.js"></script>
<script>
$(function () {
// $('#target').distpicker({
// province: '浙江省',
// city: '杭州市',
// district: '西湖区'
// });
});
</script>
</head>
<body>
<div id="target" data-toggle="distpicker" data-autoselect="3" data-province="北京市">
<select ></select>
<select ></select>
<select ></select>
</div>
</body>
</html>
可以参考:
https://github.com/fengyuanchen/distpicker