.... var sel_MedicineType = 'sel_MedicineType' + lastIndex; eval(sel_MedicineType + "= new C_Select('" + sel_MedicineType + "')"); eval(sel_MedicineType + ".BindingData(JSON.parse('" + JSON.stringify(MedicineTypeList) + "'))"); //$("input[type='text'].MedicineID").focus();//为了定位最后1行 eval(sel_MedicineType + ".Change = function () { ChangHerbQty(" + lastIndex + ",this)}") eval("$("button[data-id='" + sel_MedicineType + "']").click()"); } //项目类型控制"贴数字段" function ChangHerbQty(index, selObj) { if (selObj.value == "ClcA600003") { $("#PostsQuantity" + index).attr("disabled", true); //PostsQuantity 贴数字段 } else { $("#PostsQuantity" + index).attr("disabled", false); } }