/
test.php
84 lines (73 loc) · 1.72 KB
/
test.php
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
input[type="text"]{
background: red;
}
input[type="checkbox"]{
opacity: 0;
}
</style>
<script type="text/javascript">
var a =1;
var a1=1;
var a2=1;
function color(x) {
//var a=1;
if(a==1)
{
x.style.background="orange";
return a++;
}
if(a==2)
{
x.style.background="#ccc";
a=a-1;
}
}
function color1(x) {
//var a=1;
if(a1==1)
{
x.style.background="orange";
return a1++;
}
if(a1==2)
{
x.style.background="#ccc";
a1=a1-1;
}
}
function color2(x) {
//var a=1;
if(a2==1)
{
x.style.background="orange";
return a2++;
}
if(a2==2)
{
x.style.background="#ccc";
a2=a2-1;
}
}
</script>
</head>
<body>
<form action="t1.php">
<div style="position:relative;width: 40px;height:40px;background:yellow ">
<div id="checkbox" style="background-color: #ccc ;position:relative; width: 20px;height: 20px" onclick="color(this)">
<input type="checkbox" name="s1" value="1">
</div>
<div id="checkbox" style="background-color: #ccc ;position:relative; width: 20px;height: 20px" onclick="color1(this)">
<input type="checkbox" name="s2" value="2">
</div>
<div id="checkbox" style="background-color: #ccc ;position:relative; width: 20px;height: 20px" onclick="color2(this)">
<input type="checkbox" name="s3" value="3">
</div>
<input type="submit"></div>
</form>
</body>
</html>