时间:2022-06-07 09:20:33 | 栏目:jquery | 点击:次
获取select 选中的值:
$("#selDepUnit").children('option:selected').val();
Ajax 动态为select赋值:
$.ajax({ type: "POST", url: "/department/findDepByPid", data:"pid="+pid, success: function (data) { $("#selDep").empty(); $.each(data, function(i, item){ $("#selDep").append($("<option/>").text(item.name).attr("value",item.id)); }); }, });