我想在单击 group1 或 group2 时切换 ul
HTML
<li class="sort">
<span></span>
<a class='expand'>Group1</a>
<a style='padding-right:10px; float:right' href='#'>Delete</a>
<a style='padding-right:10px; float:right' href='#'>Edit</a>
<ul id="0" style='display:none'>
<li style='border:none' id="1" class='sort'>
<span></span>
<a href='#'>Patent 1</a>
<em style='padding-left: 60px;'>The description of patent 1</em>
<a style='padding-right:10px; float:right' href='#'>Delete</a>
<a style='padding-right:10px; float:right' href='#'>Edit</a>
</li>
<li style='border:none' id="2" class='sort'>
<span></span>
<a href='#'>Patent 2</a>
<em style='padding-left: 60px;'>The description of patent 2</em>
<a style='padding-right:10px; float:right' href='#'>Delete</a>
<a style='padding-right:10px; float:right' href='#'>Edit</a>
</li>
</ul>
</li>
我试过了
<script>
$(document).ready(function(){
$('.expand').click(function() {
$(this).next('ul').slideToggle('slow');
});
});
</script>
谢谢