Jquery select element outside of li by ID

Rune Blaze

New Member
im looking to select the follow element by id \[code\]toggleThisDiv\[/code\]. The markup looks like:\[code\] <li id="liCategory" runat="server"> <asp:HyperLink ID="lnkCategory" runat="server"> <span><asp:Literal ID="litCategory" runat="server" Visible="true" /></span> <asp:Image ID="imgMan" runat="server" Visible="false" /></asp:HyperLink> <asp:Button ID="btnToggleDiv" runat="server" Text="+" Visible="false" /> </li> <div id="toggleThisDiv" runat="server" style="display:none;margin-top:-16px;">\[/code\]And the jQuery:\[code\]$(document).ready(function () { $('[id*="btnToggleDiv"]').click(function () { $(this).next().slideToggle(100); return false; }); });\[/code\]This works when the button is outside of the listitem but this is all inside a repeater and if i leave it like that, all of the buttons created will be next to each other instead of within their associated list item. I'm looking for something within jQuery that would allow me to select the next div (toggleThisDiv), is this possible?Thankyou
 
Back
Top