我知道关键是在eles = document.getElementById('tbx').getElementsByTagName
可是我怎么选择也选择不了。
可是我怎么选择也选择不了。
解决方案 »
- jquery easyui form的ajax提交无问题,很困扰啊
- jquery问题,求教高手
- javascript控件的事件和属性靠什么来区分呢?
- 急!vbscript创建"Excel.Application"出错!
- 大家帮着看一看吧!
- 怎么获得html页面中,相同级别得节点对象(up者有分)?
- 求救,怎样用js判断同时按下了 shift+enter ,谢谢!
- 如何实现将鼠标移动到某一点,然后执行左健点击的功能
- 高分求教VB所写的COM组件的注册问题
- 求救~js大神前台如何递归ul li读取数据
- 如果设置动态添加的单元格自动换行?在线等待!!!
- 在线等待...使用window.open如果在客户端调用本地文件在ie中打开
===========================================================>
var eles = document.getElementById('tbx').getElementsByTagName('input');
{
var i=0;
var count =0;
var id = "";
for(i = 1; i< tbx.length; i++){
if(tbx.rows(i).cells(0).firstChild.checked){
count++;
id = id + "&id=" + obj.value;
}
}
if(count < 1)
{
alert("请选中删除的数据.");
return ;
}
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></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 newRowPos=tbCondition.rows.length;
if(curRow) newRowPos=curRow.rowIndex+1;
var newRow=tbCondition.insertRow(newRowPos);
newRow.attachEvent("onclick",SelectRow);
var newCell=newRow.insertCell();
newCell.attachEvent("onclick",EditTd);
newCell=newRow.insertCell();
newCell.attachEvent("onclick",EditTd);
newCell=newRow.insertCell();
newCell.attachEvent("onclick",EditTd);
newRow.insertCell();
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)">';
newRow.click();}
function EditTd(){
var src=window.event.srcElement;
if(src.tagName!="TD") return;
var strVal=src.innerText;
src.innerHTML='<input type="text" style="width:100%" onblur="EditEnd(this)" value="'+strVal+'">';
src.children[0].focus();
}
function EditEnd(src){
var strVal=src.value;
var objTd=src.parentElement;
objTd.innerHTML="";
objTd.innerText=strVal;
}
var curRow=null;
function SelectRow(){
var clickrow=window.event.srcElement;
while(clickrow.tagName!="TR"){
clickrow=clickrow.parentElement;
}
//alert(clickrow.tagName);
if(curRow)
curRow.style.backgroundColor ="#FFFFFF";
clickrow.style.backgroundColor ="#0099FF";
curRow=clickrow;
btnUp.disabled=false;
btnDown.disabled=false;
}
function Move(flag){
var len=tbCondition.rows.length;
if(len==1){alert("只有一行,无法移动!"); return;}
else if(curRow.rowIndex==len-1 && flag==1){alert("最后一行,无法下移!"); return;}
else if(curRow.rowIndex==0 && flag==-1){alert("第一行,无法上移!"); return;}
else{
var chgRow=tbCondition.rows[curRow.rowIndex+flag];
for(var i=0;i<3;i++){
var strTd=curRow.cells[i].innerHTML;
curRow.cells[i].innerHTML=chgRow.cells[i].innerHTML;
chgRow.cells[i].innerHTML=strTd;
}
chgRow.click();
}
}
</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">
</table>
</td>
</tr>
</table>
<tr>
<td align="right"><input name="btnAdd" type="button" value="添加" onClick="Add()">
<input name="btnUp" type="button" value="上移" onClick="Move(-1)" disabled>
<input name="btnDown" type="button" value="下移" onClick="Move(1)" disabled>
</td>
<td> </td>
</tr></body>
</html>