-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtest.html
More file actions
27 lines (27 loc) · 943 Bytes
/
test.html
File metadata and controls
27 lines (27 loc) · 943 Bytes
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
<!DOCTYPE HTML>
<html>
<head>
<title>Test</title>
<meta charset="utf-8"/>
<script type="text/javascript">
function toggleTimer(a) {
if(toggleTimer._timer || 0) {
clearInterval(toggleTimer._timer);
toggleTimer._timer = 0;
return;
}
var cnt = 0;
toggleTimer._timer = setInterval(function() {
a.setAttribute("data-timer", ++cnt);
}, 70);
}
</script>
</head>
<body>
<a href="javascript:void 0;" onclick="this.className = this.className ? '' : 'test'">Toggle class</a>
<br /><a href="javascript:void 0;" onclick="if(this.className) this.removeAttribute('class'); else this.className = 'test';">Toggle class + remove</a>
<br /><a href="javascript:void 0;" onclick="this.className = this.className == 'test' ? 'test-modified' : 'test'">Modify class</a>
<br /><a href="javascript:void 0;" onclick="toggleTimer(this);">Toggle fast updates</a>
<br /><div>Text nodes, <em>nodes</em>…</div>
</body>
</html>