I try to set an option being selected via its value.My code is out here.It works in FF and Chrome but not in IE.can anyone help me?
var province = $("#hideProvince").val();
if(province != ""){
$("#province option[value='"+ province + "']").attr("selected", "selected");
}
Try attr("selected", true)
instead of attr("selected", "selected")
, I found this post it may be related to what you are looking for.
var province = $("#hideProvince").val();
if(province != ""){
$("#province option[value='"+ province + "']").attr("selected", true);
}