R
rebeccatre
Below code works to insert a line into my select box. I would also
like to set the CSS class as well, but I have not been able to modify
this to work there. Can someone please help me? Thank you, I would
appreciate it so much. Rebecca
<script>
function addOption(selectbox,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
</script>
<FORM name="drop_list" action="newpage.htm" method="POST" >
<SELECT NAME="Month_list">
<Option value="">Month list</option>
</SELECT>
</form>
<!-- BELOW, WOULD LIKE TO INSERT A CSS VALUE ALSO
---------------------->
<script>
addOption(document.drop_list.Month_list,"January", "January");
</script>
like to set the CSS class as well, but I have not been able to modify
this to work there. Can someone please help me? Thank you, I would
appreciate it so much. Rebecca
<script>
function addOption(selectbox,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
</script>
<FORM name="drop_list" action="newpage.htm" method="POST" >
<SELECT NAME="Month_list">
<Option value="">Month list</option>
</SELECT>
</form>
<!-- BELOW, WOULD LIKE TO INSERT A CSS VALUE ALSO
---------------------->
<script>
addOption(document.drop_list.Month_list,"January", "January");
</script>