<TABLE id="Table1" border="1">
<TR>
<TD>
<input type="hidden" name="sxxh_id" id="sxxh_id" value="shyslysky">
</TD>
</TR>
</TABLE>
<script language="javascript">
alert(document.getElementById("sxxh_id").value);
</script>
<TR>
<TD>
<input type="hidden" name="sxxh_id" id="sxxh_id" value="shyslysky">
</TD>
</TR>
</TABLE>
<script language="javascript">
alert(document.getElementById("sxxh_id").value);
</script>
解决方案 »
- 【分享】JavaScript版变速齿轮(纯JS/CSS实现)
- B/S模式下计算客户端文件的hash值
- document.getElementById("filterFrom").filters.item(0).Apply();大侠们,帮帮小弟啊!请问这段话怎么解释?
- jsp页面中,点击增加按钮怎么自动在表格中生成一个空白行?
- 我为什么得不到-1这个值呢?
- 流氓问题,关于title信息的一个问题
- JavaScript能写客户端的注册表吗?
- 在几个js文件中怎么控制全局变量?
- 小问题 谢谢!!!
- javaScript如何删除文件的
- 谁能帮我把此程序改成能设置cookie有效期为1年的
- js奇怪问题,
request("sxh_id")就是hidden的值了
如何一点击这个TR,就把这一行中第一个TD里的两个hidden值取出来?
<tr onclick="getvalue(this)">
getvalue(obj){
应该怎么写,然后就能动态的取出每一行第一个TD里的hidden值?
}
getvalue(){
var sxh_value=?
var sxxh_value=?
}
谁能写完整,马上给分!!!
<tr>
<td height="27" width="400" align="center" nowrap onclick="alert(this.children[1].value);alert(this.children[2].value)"><input onMouseOver="this.select()" type="text" class="input5" size="4" name="oldsxh_1" id="oldsxh_12" value="0" onChange="upform()">
<input type="hidden" name="sxh_id" id="sxh_id" value="123">
<input type="hidden" name="sxxh_id" id="sxxh_id" value="456">
</td>
</tr>
</table>
<tr>
<td height="27" width="400" align="center" nowrap onclick="alert(this.children[1].value);alert(this.children[2].value)"><input onMouseOver="this.select()" type="text" class="input5" size="4" name="oldsxh_1" id="oldsxh_12" value="0" onChange="upform()">
<input type="hidden" name="sxh_id" id="sxh_id" value="123">
<input type="hidden" name="sxxh_id" id="sxxh_id" value="456">
</td>
</tr>
</table>
<tr bgcolor="<%=strBgcolor%>" onClick="changebg(this)" onDblClick="resetbg()">
<td height="27" align="center" nowrap ><input onMouseOver="this.select()" type="text" class="input5" size="4" name="oldsxh_1" id="oldsxh_12" value="<%=rs("sxh")%>" onChange="upform()" style="background:<% = StrBgcolor%>">
<input type="hidden" name="sxh_id" id="sxh_id" value="<%=rs("sxh")%>">
<input type="hidden" name="sxxh_id" id="sxxh_id" value="<%=rs("sxxh")%>"></td>
<td height="27" align="left" nowrap ><input onMouseOver="this.select()" type="text" class="input5" name="oldzbms_1" id="oldzbms_1" value="<%=rs("zbms")%>" size="<%=len(rs("zbms"))*2%>" onChange="upform(this)" style="background:<% = StrBgcolor%>"></td>
<td align="left" nowrap ><input onMouseOver="this.select()" type="text" class="input5" size="6" name="oldsxxh_1" id="oldsxxh_1" value="<%=rs("sxxh")%>" onChange="upform(this)" style="background:<% = StrBgcolor%>"></td>
<td align="left" nowrap ><input onMouseOver="this.select()" type="text" class="input5" name="oldsxms_1" id="oldsxms_1" value="<%=rs("sxms")%>" size="<%=len(rs("sxms"))*2%>" onChange="upform(this)" style="background:<% = StrBgcolor%>"></td>
<td align="left" nowrap><select>
<%=jldw%></select> </td>
<td width="8%" align="center" nowrap ><input type="text" class="input5" size="8%" name="oldgydm_1" id="oldgydm_1" value="<%=rs("zbgydm")%>" onChange="upform(this)" style="background:<% = StrBgcolor%>"></td>
<td width="31%" align="center" nowrap > <div align="center">
<select name="oldjhzb_1" id="oldjhzb_1" style="width:60">
<option value=0 selected>非集合</option>
<option value=1>集合</option>
</select>
</div></td>
</tr>然后我要在changbg(obj){}里获得这两个hidden值
我是要点击TR是就获得这两个hidden的值啊