I'm new to jQuery and I'm trying to do the following: access the child of the current div's parent ( or in other words: another child of the current div's parent ). My code looks like this ( this is what I tried ):
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> $(document).ready(function() { $("div.head").click(function() { $(this).parent().("div.content").slideToggle("normal"); //<- how? }); }); </script> <div class="box"> <div class="head"> Example </div> <div class="content"> Content here. </div> </div> I'm trying to do it this way because then I could just make more boxes the same way without having to add extra js to make it work for every box ( the toggle hide/show of each box's content).