jquery 常用操作
来源:互联网 发布:桔子影音软件 编辑:程序博客网 时间:2024/06/16 18:28
1.导入jquery cdn
<head>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script>
</head>
2.选择器操作
<body>
<p>If you click on me, I will disappear.</p>
<button id="test1">消失id </button>
<button class="test2">消失class</button>
<script type="text/javascript">
$(document).ready(function(){
$("#test1").hide()
$(".test2").hide()
$('p').hide()
})
</script>
</body>
3.显示隐藏 事件操作
$("#hide").click(function(){ $("p").hide();});$("#show").click(function(){ $("p").show();});
change事件
<select> <option>js</option> <option>python</option> <option>css</option> <option>html</option></select>
$("select").change(function(){ a = $("select").val() alert(a)})
获取input的值!
<input></input><button id="sub">SUBMIT</button><div id="ttt" uid=""></div>$("#sub").click(function(){ a = $("input").val() $("#ttt").html(a)})
赋值属性
<div id="ttt" uid=""></div>
<script type="text/javascript">$("#ttt").attr("uid",'hehe')
阅读全文
0 0
- jquery常用操作
- jquery常用操作
- jQuery表单常用操作
- jQuery表单常用操作
- jQuery常用操作
- jquery常用操作
- jquery 常用操作
- jQuery表单常用操作
- jQuery常用操作
- Jquery 常用操作
- jQuery常用操作
- jQuery 常用操作技巧
- jquery常用操作记录
- jQuery---- 常用操作
- jquery 常用操作
- jquery操作常用input
- jquery常用操作
- Jquery常用操作
- 【JSP Web】02 JSP标准语法
- HashMap相关知识点
- 11
- go的指针与函数
- docker live-restore
- jquery 常用操作
- 智能家居简单实现---使用ESP8266简单实现和APP通讯
- oracle 异机恢复 从asm到文件系统成功实例
- python 装饰器
- Fragment嵌套Viewpager嵌套Fragment,切换后数据不见了解决方案....
- Linux shell编程
- 二叉搜索树
- Android获取屏幕实际高度跟显示高度,判断Android设备是否拥有虚拟功能键
- 在图像中寻找轮廓