forked from mrmcpowned/interdimensionalcable
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
36 lines (33 loc) · 988 Bytes
/
test.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
<!DOCTYPE html>
<html>
<body>
<script>
var tx_subs = ["/r/InterdimensionalCable", "/r/NotTimAndEric", "/r/ACIDS", "/r/fifthworldvideos"];
var len_subs = tx_subs.length;
</script>
<h2>Checkboxes</h2>
<form action="">
<input type="checkbox" id="IDC">/r/InterdimensionalCable<br>
<input type="checkbox" id="NTE">/r/NotTimAndEric<br>
<input type="checkbox" id="ACI">/r/ACIDS<br>
<input type="checkbox" id="FWV">/r/fifthworldvideos<br>
</form>
<h2>JavaScript Alert</h2>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var cb_subs = new Array(4);
cb_subs[0] = document.getElementById("IDC");
cb_subs[1] = document.getElementById("NTE");
cb_subs[2] = document.getElementById("ACI");
cb_subs[3] = document.getElementById("FWV");
tx_message = "Checkeados:\n";
for (i = 0; i < len_subs; i++) {
if ( cb_subs[i].checked == true )
tx_message += " · " + tx_subs[i] + "\n";
}
alert(tx_message);
}
</script>
</body>
</html>