jqeury给DropDownList赋值和给select下拉框赋文本框的值
1:想给DropDownList控件赋值
for (var i = 2012; i <= 2020; i++) { $("#ddlYear").append("<asp:ListItem>" + i + "</asp:ListItem>"); }
$.ajax({ url: 'texts/DevelopName.txt', dataType: 'text', error: function(xhr) { alert(xhr.responseText); }, success: function(data) { $("#selName").each(function(data) { $("#selName").append("<option>" + data + "</option>"); }); } });
$("#DropDownList1").append('<option value="1">aaaaaaaaa</option>');