Add items in dropdown

Rajni.Shekhar
Posted by Rajni.Shekhar under JavaScript category on | Points: 40 | Views : 1161
function addOption(selectbox, text, value) { //selectbox id of dropdown list, text and value to be added
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}

Comments or Responses

Login to post response