标签:func jquer 插件 targe 记录 dom target pre change
今天使用distpicker遇到了一些问题,记录一下。
插件地址
需要引入的 js 文件
<script type="text/javascript" src="./././js/jquery/distpicker.data.js"></script> <script type="text/javascript" src="./././js/jquery/distpicker.js"></script> <script type="text/javascript" src="./././js/jquery/main.js"></script>
<div data-toggle="distpicker"> <select id="eprovinceName" data-province="浙江省" name="provinceName"></select> <select id="ecityName" data-city="杭州市" name="cityName"></select> <select id="edistrictName" data-district="西湖区" name="districtName"></select> </div>
$(function(){ $("#distpicker").distpicker(‘destroy‘); $("#distpicker").distpicker({ province: ‘省份名‘, city: ‘城市名‘, district: ‘区名‘, autoSelect: true, placeholder: false }); });
$("#eprovinceName").val(data.provinceName); $("#eprovinceName").trigger("change"); $("#ecityName").val(data.cityName); $("#ecityName").trigger("change"); $("#edistrictName").val(data.districtName); $("#edetailAddress").val(data.detailAddress);
本想设置初始值”—请选择—”,结果多次尝试,以失败告终。
标签:func jquer 插件 targe 记录 dom target pre change
原文地址:https://www.cnblogs.com/SofuBlue/p/9854644.html