I'm try to make a tiny script that will according to the contents of a variable hide/show a layer. But I can't see to get it working I dont get any error or anything any advice.
<html>
<head>
<title>YO</title>
<style type="text/css">
.testdiv {
position: absolute;
top: 500px;
let: 100px;
background-color: #ffcc00;
width: 200px;
height: 75px;
visibility: visible;
}
</style>
<body>
<div style="position: absolute; top: 400;">Hi<br>
<script language="javascript">
var example = "Yes";
var layergrabber;
layergrabber = document.getElementById("testdiv");
if (example == "Yes") {
document.layergrabber.style.visibility="hidden";
{
else {
document.write("false");
}
</script>
</div>
<div class="testdiv"></div>
</body>
</html>
<html>
<head>
<title>YO</title>
<style type="text/css">
.testdiv {
position: absolute;
top: 500px;
let: 100px;
background-color: #ffcc00;
width: 200px;
height: 75px;
visibility: visible;
}
</style>
<body>
<div style="position: absolute; top: 400;">Hi<br>
<script language="javascript">
var example = "Yes";
var layergrabber;
layergrabber = document.getElementById("testdiv");
if (example == "Yes") {
document.layergrabber.style.visibility="hidden";
{
else {
document.write("false");
}
</script>
</div>
<div class="testdiv"></div>
</body>
</html>
Comment