Dropdown selection by text

Rajni.Shekhar
Posted by Rajni.Shekhar under JavaScript category on | Points: 40 | Views : 1121
function DDL_SelectedIndexByText(ddl, val) {
for (var i = 0; i < ddl.options.length; i++) {
if (ddl.options.text == val) {
ddl.options.selected = true;
return;
}
}
}

Comments or Responses

Login to post response