<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的jQuery测试</title>
<script src="./jquery.js"></script>
</head>
<body>
<script type="text/javascript">
<!--单机文字消失-->
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
<!--单机文字隐藏-->
$(".hide").click(function(){
$("p").hide();
});
<!--单机文字显示-->
$("#show").click(function(){
$("p").show();
});
});
</script>
<p>不要在我的上面,否则我就隐藏了!</p>
<button id="show">显示</button>
<button class="hide">隐藏</button>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的jQuery测试</title>
<script src="./jquery.js"></script>
</head>
<body>
<script type="text/javascript">
<!--单机文字消失-->
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
<!--单机文字隐藏-->
$(".hide").click(function(){
$("p").hide();
});
<!--单机文字显示-->
$("#show").click(function(){
$("p").show();
});
});
</script>
<p>不要在我的上面,否则我就隐藏了!</p>
<button id="show">显示</button>
<button class="hide">隐藏</button>
</body>
</html>