问题寻找之表格内标签定位行数
来源:互联网 发布:网络实体店怎么开 编辑:程序博客网 时间:2024/06/07 17:46
var index = $(this).parent().parent().prevAll().length + 1;核心
<!DOCTYPE html><html><head><meta charset="UTF-8"><title></title><script src="js/jquery-1.8.2.js"></script></head><body><table border="\" cellspacing="" cellpadding=""><tr><th>Header1</th><th>Header2</th><th>Header3</th><th>Header4</th></tr><tr><td><input type="text" class="in1" value="11111" /></td><td><input type="text" class="in2" value="22222" /></td><td><select name="" class="sel"><option value="1">tttt</option><option value="2">rrrr</option><option value="3">yyyy</option></select></td><td><input type="text" class="in3" value="44444" /></td></tr><tr><td><input type="text" class="in1" value="111111" /></td><td><input type="text" class="in2" value="222222" /></td><td><select name="" class="sel"><option value="1">tttt</option><option value="2">rrrr</option><option value="3">yyyy</option></select></td><td><input type="text" class="in3" value="444444" /></td></tr><tr><td><input type="text" class="in1" value="1111111" /></td><td><input type="text" class="in2" value="2222222" /></td><td><select name="" class="sel"><option value="1">tttt</option><option value="2">rrrr</option><option value="3">yyyy</option></select></td><td><input type="text" class="in3" value="4444444" /></td></tr></table></body><script>$(function(){var i = 0;/*$(".in1").eq(i).on('click',function(){alert($(".in").index(this));$(this).parent().parent().children().eq("2").children().html('<option value="2">wwwww</option>');})*/$(".in1").on('click',function(){//alert($(".in").index(this));//找到tr后,在prevAll()var index = $(this).parent().parent().prevAll().length + 1;alert(index);//$(this).parent().parent().children().eq("2").children().html('<option value="2">wwwww</option>');})})</script></html>
阅读全文
0 0
- 问题寻找之表格内标签定位行数
- 寻找标签内的物体播放动画
- html之表格标签
- Markdown表格之表格内换行
- HTML5基础之-表格标签
- HTML高级标签之表格标签
- 爬虫之标签定位记录
- 北美求职之寻找内推资源
- 第七天:position定位、表格—table标签
- 调试之定位问题
- DIV标签的位置定位问题
- HTML 语法教学之表格标签
- PHP编程之HTML(表格标签)
- html中页面布局之表格标签
- HTML之表格标签及属性
- HTML5学习笔记之表格标签
- HTML学习7:常用标签之表格标签
- 表格标签
- MongoDB C++开发环境搭建
- 分布式消息系统:Kafka
- 使用Maven运行Java main的3种方式
- 数据控制、定义、操作
- leetcode : subtree of another tree
- 问题寻找之表格内标签定位行数
- Safari浏览器无法播放视频资源(Java后台SSM架构)的解决方法
- Apache ZooKeeper简介
- UVA 1401 Remember the Word(DP+字典树Trie)
- android LayoutAnimation
- 编写简单的连接MongoDB数据库C++程序 && 解决编译C++程序时链接MongoDB动态库失败的问题
- 分布式dubbo + zookeeper
- BAT内部级别与薪资待遇
- c++入门教程(十六)