 <p>You can store a reference to the previously opened paragraph and hide it before displaying a new one. This has the advantage of being quicker if you have lots of paragraphs.</p> <pre class="lang-js prettyprint-override"><code>// My function to open and close the p tag var para = null var evtDelegation = function(evt){ var target = evtUtility.getTarget(evt); if(target.nodeName.toLowerCase() === 'h1'){ if(para !== null) { para.style.display = 'none'; } para = evtUtility.nextSiblings(target); para.style.display = 'block'; }; }; evtUtility.addEvent(document, 'click', evtDelegation); </code></pre> <p><a href="http://jsfiddle.net/dHUPg/" rel="nofollow">http://jsfiddle.net/dHUPg/</a></p>