Hang on, there are now three different states. When display is an empty string the stylesheet takes over, when it’s “block” it shows, and when it’s “none” it is hidden again.
Things get confusing there because there is both CSS and JS affecting the visibility of the element.
It would be better to remain consistent. Either use CSS to show and hide things, or use JS to show and hide things. But not a combination of both.
I would adjust your CSS so that you have a hide class, that JS can then toggle.
.hide {
display: none;
}
You can then use that hide class to initially hide the element.
<div id="admin-content" class="hide">
<p> I am the toggle stuff </p>
</div>
And toggle that hide class from JS quite easily:
function adminToggle() {
var x = document.getElementById("admin-content");
x.classList.toggle("hide");
}