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 | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#firstdiv {
float: left;
z-index: 2;
position:absolute;
margin-top: 12px;
height:150px;
width=500px;
border:solid 1 px red;
background-color:wheat;
}
#seconddiv {
opacity: 0.7;
float: left;
margin-top: 75px;
z-index:3;
border: 1px dotted orange;
position:relative;
background-color:yellow;
}
</style>
</head>
<body>
<div id="firstdiv">
this is inside of a div tag
</div>
<div id="seconddiv">
<form name="forwardForm">
<input type="text">This is a field</input>
<input type="button" value="Go!" onclick="hideThis();" />
</form>
<div>
<script language="JavaScript">
function hideThis() {
var obj = document.getElementById('firstdiv');
if (obj.style.display != 'none') {
obj.style.display = 'none';
} else {
obj.style.display = 'block';
}
}
</script>
</body>
</html>
|