javascript executing then undoing
<p>I have an aspx page where I'm trying to hide a div based on a button click. It seems as though the javascript executes but then the div shows back up immediately. It seems like the page is refreshing as well.</p>

<pre><code>function hideDiv2()
    {
        document.getElementById("div2").style.display = "none";

    }
</code></pre>

<p>This is the html</p>

<pre><code>&lt;body&gt;
&lt;form id="form1"&gt;
&lt;div style="background-color:gray;"&gt;

    &lt;div id="div1" style="width:300px; background-color:blue;"&gt;
        &lt;button onclick="hideDiv2()"&gt;&lt;/button&gt;
    &lt;/div&gt;
    &lt;div id="div2" runat="server" style="width:300px; background-color:black; display:none;"&gt;test&lt;/div&gt;

&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p></p>
