Help with expandable div in javascript
<p>Hi i'm new to JavaScript and i am looking to learn how to put a <code>&lt;div&gt;</code> within a <code>&lt;div&gt;</code> so when the user clicks on the first one it opens the content of the second(hidden until clicked) and closes so my page wont be a million miles of scrolling down . but my problem is the all the content is displayed on page load instead of on click </p>

<p>heres the code </p>

<pre><code>&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
    &lt;title&gt;Untitled Document&lt;/title&gt;
    &lt;script type="text/javascript"&gt;
        function toggleMe(a){
           var e=document.getElementById(a);
               if(!e)return true;
               if(e.style.display=="none"){
                   e.style.display="block"
               }
               else{
                   e.style.display="none"
               }
           return true;
        }
    &lt;/script&gt;
&lt;/head&gt;
</code></pre>

<p>thank's in advance</p>

<pre><code>&lt;input type="button" onclick="return toggleMe('para1')" value="Toggle"&gt;&lt;br&gt;
&lt;p id="para1"&gt;(lots of text)&lt;/p&gt;
&lt;br&gt;
&lt;input type="button" onclick="return toggleMe('para2')" value="Toggle"&gt;&lt;br&gt;
&lt;div id="para2"&gt;(lots of text)&lt;/div&gt;
&lt;br&gt;
&lt;input type="button" onclick="return toggleMe('para3')" value="Toggle"&gt;&lt;br&gt;
&lt;span id="para3"&gt;(lots of text)&lt;/span&gt;
</code></pre>
