show hide div javascript onclick





Ive been trying to hide and show a div using javascript in my website. But i want it to be hidden by default and be able to show and hide it on click. My code seems okay and when I click the button, the display:none turns into a display:block but the div doesnt show Script>. Hope this will help you. If you want it with javascript only then you can do like below: