<SCRIPT LANGUAGE="JavaScript">
<!--
function Add(){
var o = document.createElement("option")
o.text = txtName.value
selList.options.add(o)
}
function Delete(){
selList.options.remove(selList.selectedIndex)
}
//-->
</SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="23%"><input type="text" name="txtName" maxlength="9" class="input" size="30">
<td width="77%"><input name="Submit2" type="submit" class="button" value="Add into List" onclick="Add()">
</tr>
<tr>
<td colspan="2"><p>
<select id="selList" size="5" style="width:289 ">
</select>
</p>
<p>
<input type="button" name="Submit" value="Delete" onclick="Delete()">
</p></td>
</tr>
</table>
<!--
function Add(){
var o = document.createElement("option")
o.text = txtName.value
selList.options.add(o)
}
function Delete(){
selList.options.remove(selList.selectedIndex)
}
//-->
</SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="23%"><input type="text" name="txtName" maxlength="9" class="input" size="30">
<td width="77%"><input name="Submit2" type="submit" class="button" value="Add into List" onclick="Add()">
</tr>
<tr>
<td colspan="2"><p>
<select id="selList" size="5" style="width:289 ">
</select>
</p>
<p>
<input type="button" name="Submit" value="Delete" onclick="Delete()">
</p></td>
</tr>
</table>
解决方案 »
- 百度地图API使用,怎样将中心点设定的一个行政区?
- JSChart 后台返回的数据怎么放到Array里
- asp.net 用javaScript获取 省、市、县 级联 县DropDownList 的值
- 请问怎么弹出窗口?
- 怎样把Javascript生成的Table表格中录入的数据快速插入到SQL数据库中??希望各位高手提供解决思路
- JAVASCRIPT 做的WEB打印能否打印表格内带有图像 ?
- radio与getElementById的问题
- 页面中如何检测出IE的某个“浏览器加载项”
- 请问,我这样写怎么不能实现隐藏???
- 好多精品javascript代码
- 高分求助,UTF-8->Gb2312的javaScript 在线等
- 一个简单问题,关于按钮失效
onclick="select.options[select.length]=new Option(value,value)"onclick="select.option[select.selectedIndex]=null"
---------------
新加的要在上面,下面要加多了就看不到了
<!--
function Add(){
var o = document.createElement("option")
o.text = txtName.value
selList.options.add(o,0)
}
function Delete(){
selList.options.remove(selList.selectedIndex)
}
//-->
</SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="23%"><input type="text" name="txtName" maxlength="9" class="input" size="30">
<td width="77%"><input name="Submit2" type="submit" class="button" value="Add into List" onclick="Add()">
</tr>
<tr>
<td colspan="2"><p>
<select id="selList" size="5" style="width:289 ">
</select>
</p>
<p>
<input type="button" name="Submit" value="Delete" onclick="Delete()">
</p></td>
</tr>
</table>