<script> var flag=false; function update(id) { if(confirm("确认要修改阈值吗?")) { status.updateThreshold(id,threshold,updatex); } } function updatex(data) { var e=document.getElementById("thresholdtable"); for(var i=0;i<e.rows.length;i++) { var row=e.rows[i]; if(row.id!=null && row.id!="" && row.id==data){ e.deleteRow(i); i=i-1; } } } </script> </head> <body> <table border="0" cellpadding="0" cellspacing="0" class="cTable"> <tr> <td class="contentTable"> <form jwcid="editThreshold"> <table cellspacing="0" cellpadding="0" class="sTRD1" id=thresholdtable> <tr class="title"> <td>表达式名称</td> <td>级别</td> <td>单位</td> <td>比较符</td> <td>值</td> <td>选择</td> </tr> <tr jwcid="alert_Threshold" onmouseover="this.style.backgroundColor='#E5F2FF'" onmouseout="this.style.backgroundColor='#FFFFE5'" bgcolor="#FFFFE5"> <td><span jwcid="alert_Threshold_expression"/></td> <td><span jwcid="alert_Threshold_level"/></td> <td><span jwcid="alert_Threshold_unit"/></td> <td><span jwcid="alert_Threshold_comparison_operators"/></td> <td><span id="ognl:Threshold.threshold" jwcid="alert_Threshold_threshold"/></td> <td><a href="#" jwcid="Alert_linkto_editThreshold" onclick="return false;">确认修改</a></td> </tr> </table> </form> </div> </div> </td> <td class="contentTableRight"></td> </tr> </table> </div>
</body>
</html>
<script> var flag=false; function update(id) { if(confirm("确认要修改阈值吗?")) { status.updateThreshold(id,threshold,updatex); } } function updatex(data) { var e=document.getElementById("thresholdtable"); for(var i=0;i<e.rows.length;i++) { var row=e.rows[i]; if(row.id!=null && row.id!="" && row.id==data){ e.deleteRow(i); i=i-1; } } } </script>
这里 我想 e.deleteRow(i); 这里 我想在获取到这个行对象只后 得到<td>值</td> 这个里面的文本框中的值 该怎么做啊
<td><a href="#" jwcid="Alert_linkto_editThreshold" onclick="return false;">确认修改</a></td> 去要是想在这里调用 update这个函数 想达到threshold这个 这个就是上面说的TextField里的值 可以在 if(confirm("确认要修改阈值吗?")) { status.updateThreshold(id,threshold,updatex); } 这个个里面用JS 得到吗
看了半天,大概明白了。你是想去<TD>标签之间的值,和input type=text的值。
给TD和input type=text分别定义一个ID。
var tdValue = document.getElementById("tdID").innerText;
var textValue= document.getElementById("inputId").value;