<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
<script language="javascript">
function Add(){
if(dltLocation.selectedIndex==-1) {alert("请选择地点!");return;};
if(dltEducation.selectedIndex==-1) {alert("请选择学历!");return;};
if(dltMoney.selectedIndex==-1) {alert("请选择钱数!");return;};
var newRow=tbCondition.insertRow(0);
newRow.insertCell();
newRow.insertCell();
newRow.insertCell();
newRow.insertCell();
alert(dltLocation.value);
newRow.cells[0].innerText=dltLocation.value;
newRow.cells[1].innerText=dltEducation.value;
newRow.cells[2].innerText=dltMoney.value;
newRow.cells[3].innerHTML='<input type="button" value="删除" onclick="this.parentNode.parentNode.removeNode(true)">';
}
function Delete(){
//功能比较简单,自己写吧
}
</script>
</head><body>
<table width="450" border="1" cellspacing="0" cellpadding="0" ID="Table1">
<tr>
<td width="150"><select name="dltLocation" id="dltLocation" multiple size="6" style="width:100% ">
<option value="北京">北京</option>
<option value="广州">广州</option>
</select></td>
<td width="150"><select name="dltEducation" id="dltEducation" multiple size="6" style="width:100% ">
<option value="本科">本科</option>
<option value="专科">专科</option>
</select></td>
<td width="150"><select name="dltMoney" id="dltMoney" multiple size="6" style="width:100% ">
<option value="1000">1000</option>
<option value="2000">2000</option>
<option value="3000">3000</option>
</select></td>
</tr>
<tr>
<td align="right" colspan="3"><input name="btnAdd" type="button" value="添加" onClick="Add()" ID="Button1"></td>
</tr>
<tr>
<td colspan="3">
<table id="tbCondition" width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table></body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
<script language="javascript">
function Add(){
if(dltLocation.selectedIndex==-1) {alert("请选择地点!");return;};
if(dltEducation.selectedIndex==-1) {alert("请选择学历!");return;};
if(dltMoney.selectedIndex==-1) {alert("请选择钱数!");return;};
var newRow=tbCondition.insertRow(0);
newRow.insertCell();
newRow.insertCell();
newRow.insertCell();
newRow.insertCell();
alert(dltLocation.value);
newRow.cells[0].innerText=dltLocation.value;
newRow.cells[1].innerText=dltEducation.value;
newRow.cells[2].innerText=dltMoney.value;
newRow.cells[3].innerHTML='<input type="button" value="删除" onclick="this.parentNode.parentNode.removeNode(true)">';
}
function Delete(){
//功能比较简单,自己写吧
}
</script>
</head><body>
<table width="450" border="1" cellspacing="0" cellpadding="0" ID="Table1">
<tr>
<td width="150"><select name="dltLocation" id="dltLocation" multiple size="6" style="width:100% ">
<option value="北京">北京</option>
<option value="广州">广州</option>
</select></td>
<td width="150"><select name="dltEducation" id="dltEducation" multiple size="6" style="width:100% ">
<option value="本科">本科</option>
<option value="专科">专科</option>
</select></td>
<td width="150"><select name="dltMoney" id="dltMoney" multiple size="6" style="width:100% ">
<option value="1000">1000</option>
<option value="2000">2000</option>
<option value="3000">3000</option>
</select></td>
</tr>
<tr>
<td align="right" colspan="3"><input name="btnAdd" type="button" value="添加" onClick="Add()" ID="Button1"></td>
</tr>
<tr>
<td colspan="3">
<table id="tbCondition" width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table></body>
</html>
解决方案 »
- opera 不支持onbeforeunload 有其他方法代替吗?
- ajax操作的时候,显示“正在加载中……”这个怎么弄?
- 谁用过jquery的tabs的 为什么的tabs 切换不了?
- 关于百度的popup弹出浮动窗口例子
- 用Js如何实实HTML中frame的效果?
- 模仿sina的图片切换javascript代码失效和去除flash边框的代码均失效。请教解决办法
- javascript的一个小问题
- Jquery怎样获取网络图片的宽高?
- 请问能不能用在一个网页中的iframe框里取得其中网页里的form表单里的值
- 如何去除IE的菜单条,工具条,地址条和状态条,并且屏蔽热键“F5”和右键菜单,谢谢
- 100分急求一个小东西的源码 赶紧来挣分!!!
- 对于一个已显示好的表格,如何让用户可以随意改变其列的顺序?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
<script language="javascript">
function Add(){
if(dltLocation.selectedIndex==-1) {alert("请选择地点!");return;};
if(dltEducation.selectedIndex==-1) {alert("请选择学历!");return;};
if(dltMoney.selectedIndex==-1) {alert("请选择钱数!");return;};
var newRow=tbCondition.insertRow(0);
newRow.insertCell();
newRow.insertCell();
newRow.insertCell();
newRow.cells[0].innerText=dltLocation.value;
newRow.cells[1].innerText=dltEducation.value;
newRow.cells[2].innerText=dltMoney.value;
}
function Delete(){
var val = prompt("请输入要删除的行号","0");
if(val == "")
{
alert("请输入要删除的行号");
return;
}
var intVal = parseInt(val,10);
var oTable = document.all.tbCondition;
if(intVal >= oTable.rows.length)
{
alert("行号不能超过表格行数的最大值");
return;
}
oTable.rows[intVal+1].removeNode(true);
}
</script>
</head><body>
<table width="450" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="150"><select name="dltLocation" id="dltLocation" multiple size="6" style="width:100% ">
<option value="北京">北京</option>
<option value="广州">广州</option>
</select></td>
<td width="150"><select name="dltEducation" id="dltEducation" multiple size="6" style="width:100% ">
<option value="本科">本科</option>
<option value="专科">专科</option>
</select></td>
<td width="150"><select name="dltMoney" id="dltMoney" multiple size="6" style="width:100% ">
<option value="1000">1000</option>
<option value="2000">2000</option>
<option value="3000">3000</option>
</select></td>
</tr>
<tr>
<td colspan="3">
<table id="tbCondition" width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
<tr>
<td align="right"><input name="btnAdd" type="button" value="添加" onClick="Add()"></td>
<td> </td>
<td><input name="btnDelete" type="button" value="删除" onClick="Delete()"></td>
</tr></body>
</html>