td中通过button绑定click事件实现跳转,以及获取同一table中另一td的值
2017-07-05 11:21
302 查看
1、通过button绑定事件跳转到同一页面的其他div
例:
js页面
javascript脚本
js页面需要引入jquery的插件
例:
js页面
<table id = "tableid"> <tr> <td id = "rcode">"123456"</td> <td><button type="button" id="buttonid" onclick="javascript:toManager(this)"></button></td> </tr> </table> <div id ="manage">跳转到的位置</div>
javascript脚本
<script type="text/javascript"> function toManager(r){ window.location.hash = "#manager"; var clickRow = r.parentNode.parentNode.rowIndex;//获取button行所在table的index alert(clickRow); var rcode = $(r).parent().parent().find("#rcode").val(); //rcode为另一td的id alert(rcode); } </script>
js页面需要引入jquery的插件
相关文章推荐
- Ajax实现无刷新的获取数据并绑定到GridView,以及无刷新更新数据
- Ajax实现无刷新的获取数据并绑定到GridView,以及无刷新更新数据[转]
- jquery遍历table的tr获取td的值实现方法
- 通过ddmlib实现截图以及获取手机相关信息
- JQuery 绑定select标签的onchange事件,弹出选择的值,并实现跳转、传参(selected的值和页面其它元素的值)以及js的select
- 微信小程序实现页面跳转传值以及获取值的方法分析
- 点击tableView后面的button,通过响应者链条原理实现
- 通过接口获取所有实现类以及通过注解获取实现类的思路
- jquery遍历table的tr获取td的值实现方法
- jquery遍历table的tr获取td的值实现方法
- 在 Vue 项目中关于 table查询 以及 页面跳转 的实现
- 如何通过Spring获取到Hibernate的Configuration对象以及Table,Column对象
- 通过点击cell上的Button获取tableView的indexPath
- 用jQuery获取table中行id和td值的实现代码
- VUE-Table上绑定Input通过render实现双向绑定数据的示例
- ContentProvider获取系统的电话号码绑定到ListView以及跳转通讯录获区联系人信息绑定到前台。
- 过滤器通过HttpServletResponseWrapper包装HttpServletResponse实现获取response中的返回数据,以及对数据进行gzip压缩
- 通过cell中的元素获取cell的indexPath以及长按tableview获取选中cell的indexPath
- jquery遍历table的tr获取td的值实现方法
- 用jQuery获取table中行id和td值的实现代码