链接:https://pan.baidu.com/s/1NE_EO5_xGvR-y-lboYap7g 
提取码:h00e 

效果展示:

 js三级联动效果city-picker

解决:

动态赋值:

注意:在执行赋值之前,必须执行reset和destroy操作

<div style="position: relative;"><!-- container -->
<input id="city-picker1" readonly type="text">
  <input id="set" type="button" value="赋值"/>
</div>
<script type="text/javascript">
    $(function(){
        $("#city-picker1").citypicker();
        $("#set").click(function() {
            $("#city-picker1").citypicker("reset");
            $("#city-picker1").citypicker("destroy");
            $("#city-picker1").citypicker({
              province: '江苏省',
              city: '宿迁市',
              district: '沭阳县'
            });
        });
    });
</script>

 

相关文章:

  • 2021-11-29
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-05-05
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
相关资源
相似解决方案