|
Javascript functin to add elements to a drop down list or options.
function addOption(ddl,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
ddl.options.add(optn);
}
This is how u call the function
addOption(document.getElementById("<%=ddlCity.ClientID%>"),CITYNAME,CITYCODE);
|