Javascript: Hiding and Showing div tag with a toggle button
问题 I'll get right to it: What I need to do is hide a particular div with the press of a button, and it's supposed to be a toggle, so basically: Press once to hide, press again to show, press again to hide etc... I want the hide/show rules to be done in CSS and the interaction in pure javascript (no jquery please). Well this is what I need to do, but I'm not quite sure how to execute the javascript code. html: <p class="button">Show/hide<p> <div> I want to hide this by pressing the button above<