I have a button that changes the visibility of a div. It turns it from being visible to hidden and then back every time it's pressed. How can I make the div stay hidden and make the button show it when it's pressed.
<script>
function Hide() {
var x = document.getElementById("box");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
<button id="Hidden" onclick="Hide()">Click me</button>
<div id="box">
Sample text.
</div>