-
Notifications
You must be signed in to change notification settings - Fork 0
/
disabled.html
78 lines (71 loc) · 1.48 KB
/
disabled.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<button id="btn">点击</button>
<table id="tBody">
<thead>
<tr>
<th>标题1</th>
<th>标题2</th>
<th>标题3</th>
<th>标题4</th>
<th>标题5</th>
</tr>
</thead>
<tbody>
<tr>
<td>内容1</td>
<td>内容2</td>
<td>内容3</td>
<td>内容4</td>
<td>内容5</td>
</tr>
<tr>
<td>详情1</td>
<td>详情2</td>
<td>详情3</td>
<td>详情4</td>
<td>详情5</td>
</tr>
<tr>
<td>知道1</td>
<td>知道2</td>
<td>知道3</td>
<td>知道4</td>
<td>知道5</td>
</tr>
</tbody>
</table>
</body>
<script src="js/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#btn").click(function() {
var users = new Array();
//过滤掉了表头 从第2行开始遍历
$("#tBody tr:gt(0)").each(function() {
var tr = $(this);
//演示
var userInfo2 = {
number: tr.find("td").eq(0).text(),
name: tr.find("td").eq(1).text(),
state: tr.find("td").eq(2).text(),
icon: tr.find("td").eq(3).text(),
five: tr.find("td").eq(4).text()
};
//数组
var userInfo = tr.find("td").eq(3).text();
if(userInfo=="内容4") {
alert("找到了");
}
// users.push(userInfo);
});
// alert(JSON.stringify(users));
});
});
</script>
</html>