可以试一下.<table>
<tr><td>表格一</td><tr>
</table><table>
<tr><td>表格二</td><tr>
</table><script>
function bao()
{
//取得所有表格.
var tb = document.getElementsByTagName("table");
//取得表格一.
alert(tb[0].rows[0].cells[0].innerText);
}
</script>
<input type="button" onclick="bao()">
<tr><td>表格一</td><tr>
</table><table>
<tr><td>表格二</td><tr>
</table><script>
function bao()
{
//取得所有表格.
var tb = document.getElementsByTagName("table");
//取得表格一.
alert(tb[0].rows[0].cells[0].innerText);
}
</script>
<input type="button" onclick="bao()">
解决方案 »
- javascript和jquery一起用的问题
- extJs 3.0获取不到值问题
- 睡觉送分贴
- 关于javascript语法中的疑问,请指教!
- 求JS模拟鼠标点击的函数
- 我想去掉下拉框的按钮,就和input一样,但是要实现和下拉框一样的功能,即点击这个框,即下拉出可选项
- 关于帧结构中关闭窗口的问题(马上结)
- 高分求助,代码如下,当你在界面输入数据之后,再点时间控件就出"安全提示"(在不改IE安全级别的条件下),如何做呢?
- ajax中的消息头是啥回事
- 如何将\\u8BF7\\u9009\\u62E9 这样的字符串转为汉字
- 怎样实现回车后光标自动移到下一个输入框?
- 在javascript,怎样打开一个excel文件,并往里面写东西。
页面上可以动态增加表格,怎么获得他们的索引?
有没有人告我!我很急!使用dhtml
页面上有多个div,
页面上有多个button,
当动态增加时候,我给他们相同的id,
例如:
<div id="d">1</div>
<div id="d">1</div>
<div id="d">1</div>
<div id="d">1</div>
<div id="d">1</div>
我就是想获得它们的索引?例如表格中的sectionRowIndex可以获得表格中的索引一样!
加了这个Optional,就不能定义数组,
想传数组,就不要加OptionalPublic Sub UpLoading1060AllDatas(pComm As MSComm, pForm As Form, pIsPass As Boolean, Optional pSecstr As Integer)这样正确Public Sub UpLoading1060AllDatas(pComm As MSComm, pForm As Form, pIsPass
As Boolean, pSecstr() As Integer)这样也正确,
加了这个Optional,就不能定义数组,
想传数组,就不要加OptionalPublic Sub UpLoading1060AllDatas(pComm As MSComm, pForm As Form, pIsPass As Boolean, Optional pSecstr As Integer)这样正确Public Sub UpLoading1060AllDatas(pComm As MSComm, pForm As Form, pIsPass
As Boolean, pSecstr() As Integer)这样也正确,