Skip to content Skip to sidebar Skip to footer

Toggle Reveal Div With Javascript. Start Hidden, Click To Reveal

I would like to toggle whether a div is visible using a button to hide/reveal the div on click. I have code which will do this, but the div is visible on page load by default. I'd

Solution 1:

Change

<div id="myDIV">

to

<div id="myDIV" style="display: none;">

Solution 2:

You can use the style attribute:

<div id="myDIV" style="display: none">

Post a Comment for "Toggle Reveal Div With Javascript. Start Hidden, Click To Reveal"