第五十五天jQery内容的进阶
1.上节课内容回顾: <div id="left"> <div class="title">菜单一 <div class="menu hidden"> <a href="">第一个</a><br> <a href="">第二个</a><br> <a href="">第三个</a> </div> </div> <div class="title">菜单二 <div class="menu hidden"> <a href="">第一个</a><br> <a href="">第二个</a><br> <a href="">第三个</a> </div> </div> <div class="title">菜单三 <div class="menu hidden "> <a href="">第一个</a><br> <a href="">第二个</a><br> <a href="">第三个</a> </div> </div> </div> <script src="jquery-3.4.1.min.js"></script> <script> $('.title').click(function(){ $(this).children().removeClass('hidden'); $(this).siblings().children().addClass('hidden');