Toggle jQuery function onload code behind asp.net

Toggle jQuery function onload code behind asp.net

I have inherited a project that uses jQuery and I am really not familiar enough with it to figure out how to change this to do what I want it to do. I am currently coding in ASP.NET (VB) and I have a working fully functional jquery function to toggle a slider and change a class. The class more or less just switches the image on the button from "Show Text" to "Hide Text" and then expands the div to show the text inside of it.  All of that is good and well and works fine.

Now, during the page load it adds items programatically from a database and I need to be able to "activate" for the lack of a better term one of those items (selected one from a previous page). I have tried multiple things Page.RegisterClientScriptBlock, etc, but they either don't do anything or break the existing code. Can someone tell me if there's some sort of easy way to do this? Below is my code:  



< script type ="text/javascript">
      $(document).ready( function () {
            $( "#item-list .closed" ).click(
      function () {
            $(th is ).siblings( "div" ).stop( true , true ).slideToggle();
            }
      );
      $( '#item-list .closed' ).click( function () {
            $( this ).toggleClass( 'open' );
            });
      });
</script>
The list items are created on page load and are populated in the lblItem Literal.  I've only recently added the id and runat tags trying to get it to work from code-behind.

<ul id="item-list">

      <span id ="togglebuttons" runat ="server" class ="closed btns"></ span >
 
      <div id ="litDiv" runat ="server">
            < asp : Literal ID ="lblItem" runat ="server" />
      </ div >
</ ul >
 
Please let me know if you need any more information in order to help me along.