Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
document.formname.listname.options[n] = new Option("Text","Value")
<SCRIPT LANGUAGE="JavaScript">
<!--
// You create a new OPTION with
var opt = new Option('text', 'value');
// and insert it with
var sel = document.formName.selectName;
sel.options[sel.options.length] = opt;
// at the end of the SELECT list.
// To insert into the middle move other options up e.g.
function insertOptionAt (select, option, index) {
for (var i = select.options.length; i > index; i--)
select.options[i] = select.options[i - 1];
select.options[index] = option;
}
// example call
insertOptionAt (document.formName.selectName, new Option('text', 'value'), 3);
// You delete an OPTION simply be setting
var sel = document.formName.selectName;
sel.options[optionIndex] = null;
//-->
</SCRIPT>