jquery 纯JS设置select下拉框,并默认选中第一个
//html页面<select id="payWay" class="easyui-combobox" name="payWay" style="width: 100%;" data-options="required:true,editable:false"> </select> //JS文件function getPayedWay(){ $.ajax({ type : "GET", url : top.baseUrl + "auction/settlement_bail/get/payed/type", data : null, dataType : 'json', success : function(result) { var typeStr = ''; $.each(result, function(index, temp) { typeStr += '<option value=' + temp.id + '>' + temp.name + '</option>'; }); $('#payWay').html(typeStr); $('#payWay').combobox({}); var data = $('#payWay').combobox('getData'); $("#payWay").combobox('select',data[0].value); },