jquery切换效果怎么各切换各的,就是单个切换单个的,不要点一个按钮就全都隐藏了或显示了
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".btn1").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<button class="btn1">Toggle</button>
<p>This is a paragraph.</p>
<button class="btn1">Toggle</button>
<p>This is a paragraph.</p>
<button class="btn1">Toggle</button>
<p>This is a paragraph.</p>
<button class="btn1">Toggle</button>
<p>This is a paragraph.</p>
<button class="btn1">Toggle</button>
</body>
</html>
子衿沉夜
相关分类