<html><head><script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript">$(document).ready(function(){ $(".btn1").click(function(){ $("p").toggle(true); });});</script></head><body><p>This is a paragraph.</p><p style="display:none">This is another paragraph.</p><p>把 switch 参数设置为 false,可以隐藏所有段落。</p><button class="btn1">显示所有 p 元素</button></body></html>