0

I created a box which contains links inside it. I do not understand why it does not disappear when page has loaded. I wanted to appear when a button onclick = "ore();" is clicked.

<script>
  document.getElementById("hid").style.display = "none";
  function ore(){
    document.getElementById("hid").style.diplay = "block";
  }
</script>
<div class= "borl" id = "hid" style = "position: absolute; text-align: center; width: auto; height: auto; left: 46%; top: 30%;">
  <a href = "#">Notifications</a><br>
  <a href = "#">Logout</a><br>
  <a href = "#">Report</a><br />
  <a href = "#">Bizzy Emails</a><br>
  <a href = "#">Help and Support</a>
</div>
Bhavik Hirani
  • 1,764
  • 4
  • 24
  • 38

1 Answers1

1

you have to add your script after html

<div class="borl" id="hid" style="position: absolute; text-align: center; width: auto; height: auto; left: 46%; top: 30%;">
  <a href="#">Notifications</a><br>
  <a href="#">Logout</a><br>
  <a href="#">Report</a><br />
  <a href="#">Bizzy Emails</a><br>
  <a href="#">Help and Support</a>
</div>
<button onclick="ore()">show</button>
<script>
  document.getElementById('hid').style.display = "none";
  function ore(){
    document.getElementById('hid').style.display = "block";
  }
</script>
Bhavik Hirani
  • 1,764
  • 4
  • 24
  • 38