Javascript:
<script language = 'javascript'>
function AddItem()
{
document.getElementById('s').add(new Option('A','1',false,false));
document.getElementById('s').add(new Option('B','2',false,false));
document.getElementById('s').add(new Option('C','3',true,true));
}
</script>
VBScript:
<script language = 'vbscript'>
Function AddItem()
set Opt = document.createElement("option")
Opt.Text = "HSP"
Opt.Value = "s"
s.Add Opt, 0
set Opt1 = document.createElement("option")
Opt1.Text = "Test"
Opt1.Value = "T"
s.Add Opt1, 1
End Function
</script>
<select id = 's'></select>
<input type = 'button' onclick = "AddItem()" value = "Add Item" />
No comments:
Post a Comment