sample code to Clear the elements of a drop down list using javascript.
Usage
ClearOption(document.getElementById("<%=ddlCity.ClientID%>"));
Function
function ClearOption(ddl)
{
for(var i=(ddl.options.length-1); i>0; i--)
{
ddl.options[i] = null;
}
}
|