<SCRIPT type="text/javascript"> function addCombo() { var combo = document.frm.combo; var option = null; var text = null; for( i = 0; i < 4; i++ ) { option = document.createElement("OPTION"); option.setAttribute("value", i+1); text = document.createTextNode("オプション"+(i+1)); option.appendChild(text) combo.appendChild(option) } } </SCRIPT> <FORM name="frm"> <SELECT name="combo" style='width:150px;'> </SELECT> </FORM> <INPUT type="button" value="データ追加" onclick='addCombo();'>
|