parentNode.parentNode.parentNode...parentNode.rowIndex不过最好还是给tr加个id
解决方案 »
- 求js高手帮忙解决firefox支持打开网络地址文件夹,或有了解相关jquery插件也可以。
- google地图 本地搜索的问题。求高手帮忙
- javascript 事件处理 概念不懂
- 打印问题
- javascript语法的一个问题
- js判断休息时间啊 大神看过来啊
- 如何设置“放于层内的”层的left和top为相对于屏幕的值?
- JavaScript能动态的改变当前页面的文档显示效果吗?
- 两个问题100分,分给少了好象没人回答。
- 定时器之一个有意思的问题,感兴趣的可以解答一下
- 帮忙结贴 帮忙告诉我几个3dmax的学习网站最好是视频的那种 [多媒体/设计/Flash/Silverlight 开发][多媒体设计(3DMaX, Maya等)]
- 求一个可以运行ActiveXObject("htmlfile")的例子
这个东西我理解,但我在get()这里面传什么参数呢?
是传get(this)吗?
然后function get(this){
alert(this.parentNode.parentNode.parentNode...parentNode.rowIndex);
}
对不起,我水平很菜,我这样试过了不行的啊
function get(_this){
alert(_this.parentNode.parentNode.parentNode...parentNode.rowIndex);
}
<table id=table1>
<tr> </tr>
<tr> </tr>
<tr> <td> <table> <tr> <td> <a href=javescript:get(this); </td> </tr> </table> </td> </tr>
</table>
alert(_this.parentNode.parentNode.parentNode...parentNode.rowIndex);
} 这个里面的parentNode,是不是应该5个?为什么function get(_this),这里面参数要有下划线
function get(_this){
alert(_this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rowIndex);
}
</script><table id=table1>
<tr> </tr>
<tr> </tr>
<tr> <td> <table> <tr> <td> <a href="javascript:get(this)">asd</a> </td> </tr> </table> </td> </tr>
</table>
这样还是没做用,哪位帮忙看一下,我是错在哪了呢非常感谢
<tr> </tr>
<tr> </tr>
<tr> <td> <table> <tr> <td> <a onclick="get(this)">aa</a> </td> </tr> </table> </td></tr>
</table>
<script>
function get(_this){
alert(_this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.rowIndex);
}
</script>