<select runat="server" id="sctFieldMain">
<option></option>
</select>
$(xml).find("FieldMain").each(function()
{
var value=$(this).find('Title').text()
$('#<%=sctFieldMain.ClientID %>').
append($("<option></option>").
attr("value",value).
text(value));
});
alert($("#<%=sctFieldMain.ClientID %> option:selected").text());
这retrun <%= sctFieldMain.ClientID%>
或
alert($("#<%=sctFieldMain.ClientID %> option:selected").val());
这retrun不确定
或
alert($("#<%=sctFieldMain.ClientID %> option:selected").html());
返回NULL
我喜欢得到Cureent文本。所选
你不需要分号在你VAL结束()或文本()BTW – Andrew 2011-03-14 11:20:14
您是否尝试过:$('#<%= sctFieldMain.ClientID%>')。val(); – Andrew 2011-03-14 11:26:49
return'' – ashkufaraz 2011-03-14 11:31:29