I wanted to make a button to hide the weather section of my website landing page but i do not know how to make it!
I currently use a "selector" so i can select either 0
or 1
which you can see in the bottom right, and it works nicely but i would perfer a button. Here is my current code that i use:
</div>
<div class="wopacity">
<select onchange="myFunction(this);" size="2">
<option>0
<option selected="selected">1
</select>
<script>
function myFunction(x) {
// Return the text of the selected option
var opacity = x.options[x.selectedIndex].text;
var el = document.getElementById("p1");
if (el.style.opacity !== undefined) {
el.style.opacity = opacity;
} else {
alert("Your browser doesn't support this example!");
}
}
</script>
</div>