I managed to hide and show a div using this Javascript code:
<script>
function myFunction() {
var x = document.getElementById("menudesplegable");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
The issue I face is that when the element is not visible, it does not take any space, but when visible, it moves all the other content down. It is a menu toggle, so I need all the other content to be in the same position and this div to display on top. Is it possible?