Script:
let menu = function(){
var obj = document.getElementById("hidden")
if(obj.style.display = "block"){
obj.style.display = "none"
//hide the div element with an ID #Hidden
}else{
obj.style.display = "block"
//else show it
}
}
// I tried using buttons too, same result.
CSS
div#hidden{
display:none;
}
HTML:
<a href="javascript:menu()"id="info" > INFO </a>
<div id="hidden">
<!-- some stuff -->
</div>
I'm trying to "constantly" change the display property of my DIV element with an ID "hidden" to show and hide -VICEVERSA
Apparently this code runs but! it won't run or do anything to my code the second time this event is called.
the codes inside the if statements are executed but doesn't do anything or change my display property