...and want to collapse the nested ul when the li is clicked. Before I was using
...but this obviously causes a problem when a li doesn't have a ul nested after it. Is there a better way to do this, or is there a way for me to determine if the object returned by $(this).next() is a UL?
以上就是How can I collapse a nested list using jQuery?的详细内容，更多请关注web前端其它相关文章！