1.在使用input页面加载script的引用
<script src="js/distpicker/distpicker.data.js"></script>
<script src="js/distpicker/distpicker.js"></script>
注意:必须使用jquery
<script src="js/jquery-3.2.0.min.js"></script>
Html结构:<div data-toggle="distpicker" class="clearfix down">
<div class="form-group">
<select class="form-control" id="province1"></select>
</div>
<div class="form-group">
<select class="form-control" id="city1"></select>
</div>
</div>
2.若想获取省市的传递值
在html页面加入一个:
<input name="competition_area" type="hidden" value="" id="competition_area">
在js加上:
var select = $(".form-control").find("option:selected").text();
var o = document.getElementById("competition_area");
o.value = select;
在form表单提交时就会提交上
$('#form').serialize()
competition_area= “”