学习jquery小测试 自娱自乐

来源:互联网 发布:linux内核开发流程 编辑:程序博客网 时间:2024/04/30 18:53
<!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>
0 0
原创粉丝点击