<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button[name='button']").click(function(){
$("p").hide();
}
)
$("button[name='show']").click(function(){
$("p").show();
})
;
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button" name="button">Click me hide</button>
<button type="button" name="show">show</button>
</body>
</html>
運行效果閽效果圖