bootstrat 设置 select option 选项的值

<script>
    /**
         //把textarea替换成一个编辑器
        UE.getEditor('22upTips',{
            initialFrameWidth:"80%",
            initialFrameHeight:"200"
        });
    **/
      $(document).ready(function() {
        //select change 
        $("#app_type").change(function(){
             var app_type=$(this).val();
             var url="./index.php?module=operation&action=SelectChange";
             var post_value = "app_type="+app_type;
             $.ajax({
                type: "POST",
                 url: url,
                 data: post_value,
                dataType: 'json',
                success: function(data){
//清空option $(
"#upVer").empty(); if(data==0){ alert('更新失败'); }else{ $(data).each(function(k,v){ //设置option选项 document.getElementById("upVer").innerHTML +=v[0].option; $("#mainVer").val(v.mainVer); $("#upTips").val(v.upTips); $("#assetPath").val(v.assetPath); $("#newUpiniPath").val(v.newUpiniPath); $("#appStore").val(v.appStore); $("#forceUpdateVersion").val(v.forceUpdateVersion); }); //刷新 $('#upVer').selectpicker('refresh'); } } }); }); }); </script>

相关资料:http://silviomoreto.github.io/bootstrap-select/

原文地址:https://www.cnblogs.com/hgj123/p/4496858.html