-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut5Teste.html
More file actions
125 lines (93 loc) · 2.24 KB
/
tut5Teste.html
File metadata and controls
125 lines (93 loc) · 2.24 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<title>Tut 5 Teste</title>
<script language="javascript" type="text/javascript">
function expand(rid) {
//document.write("Am intrat in row");
var node = document.getElementById(rid);
while (node.firstChild) {
//node.removeChild(node.firstChild);
}
alert("Method executed");
return true;
}
function alertme() {
//alert("Click on the table");
return true;
}
function removeLines(id) {
var node = document.getElementById(id);
while (node.firstChild) {
node.removeChild(node.firstChild);
}
}
function process(id) {
node = document.getElementById(id);
node.appendChild(document.createTextNode("newText"));
return true;
}
</script>
</head>
<body>
<table border="1" id = "table" onclick="alertme()">
<tr>
<th>
Name
</th>
<th>
Current status
</th>
<th>
Conversion rate
</th>
</tr>
<tr id="r1" onclick="expand(r1);">
<td id="c11">
Hue
</td>
<td>
Working
</td>
<td>
3.5%
</td>
</tr>
<tr id="r2">
<td>
Bahue
</td>
<td>
Broken
</td>
<td>
25%
</td>
</tr>
<tr id="r3">
<td>
Ahue
</td>
<td>
Working
</td>
<td>
17%
</td>
</tr>
</table>
<br />
<div id="div">
<p id="p1"> Line 1 </p>
<p> Line 2 </p>
<p> Line 3 </p>
</div>
<input type="button" onclick="removeLines('div');" value="Remove">
<br />
<br />
<input type="button" onclick="process('p1');" value="Expand">
<br />
<br />
<input type="button" onclick="addRow('table');" value="Add">
<br />
</body>
</html>