学习jquery小测试 自娱自乐
2016-05-10 00:09
471 查看
<!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>
相关文章推荐
- 解决jquery无法找到其他父级子集问题的方法
- jQuery事件的绑定、触发、及监听方法简单说明
- 使用jQuery处理AJAX请求的基础学习教程
- 详解原生JavaScript实现jQuery中AJAX处理的方法
- jquery实现浏览器全屏和浏览器退出全屏
- jQuery 测试案例(一)
- jquery 删除js数组元素
- jquery拖拽
- Jquery中bind和live.one,delegate的区别
- jQuery闭包学习笔记
- Jquery实现缓慢显示下拉菜单
- 关于pjax.reload()加载页面时出现aborted超时终止的问题
- jQuery实现手机竖直手风琴效果
- jquery选项卡
- jQuery中的$(document).ready()与js中的window.onload
- jQuery的XX如何实现?——1.框架
- JQuery入门
- Jquery中动态的给元素绑定事件
- jquery中的$(document).ready()、JavaScript中的window.onload()以及body中的onload()、DomContentLoaded()区别
- 关于jquery 取值,赋值常用控件的问题