how to hide div with Class/id with jQuery
<p>I have a function openbag(); for opening div. this div is also open on click and addClass "active". but i am open this div from server side, call the function openbag();. but the problem is this div is open every time when refresh the other page. I have removed "active" class and check if class has not but this is always showing. here is my code i am using.</p>

<pre><code>function openBag() {
   $("#bag").addClass("active");
   $("#expanding-bag").slideDown("fast");
  }


$(document).ready(function () {
    if ($("div#bag").hasClass("active")) {
        $("#expanding-bag").show();
        $("#bag").removeClass("active");
    }

    else {
        $("#expanding-bag").hide();
    }
</code></pre>

<p>in c# :</p>

<pre><code>Page.ClientScript.RegisterStartupScript(typeof(Page), "alert", "&lt;script language='javascript'&gt;openBag();&lt;/script&gt;");
</code></pre>
