$(document).ready(function(){ //var uls = $("ul "); //Find the a node under ul var as = $("ul > a"); as.click(function(){ //First find the current ul li in , and then let li display //Get the currently clicked ul node var aNode = $(this); //Find all li nodes under the clicked ul node var lis = aNode.nextAll("li"); //Show or hide the li child nodes of ul lis.toggle("slow"); }); });
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn