jquery种种
来源:互联网 发布:maya2015软件补丁更新 编辑:程序博客网 时间:2024/05/01 11:56
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title>jquery的各种</title> <script src="date/js/jquery-2.2.2.js"></script> <script>// window.onload=function(){//// }等价于// $(document).ready(function(){//// })等价于 $(function(){// 点击隐藏,click、hide用法// $("p").click(function(){// $(this).hide();// });// each用法// $("input").click(function(){// $("li").each(function(){// alert($(this).text())// });// }); //多选框以及下拉列表中each的用法// $("#dw").click(function(){// alert($("input[type=checkbox]:checked").length)// })// $("#d").click(function(){// $("select option:selected").each(function(xuhao,shenme){// alert($(shenme).text());// })// }) // each处理一维数组// var arr1 = [ "aaa", "bbb", "ccc" ];// $.each(arr1, function(i,val){//// alert(i);// alert(val);// }); // each处理二维数组// var arr2 = [['a', 'aa', 'aaa'], ['b', 'bb', 'bbb'], ['c', 'cc', 'ccc']]// $.each(arr2, function(i, item){// $.each(item,function(j,val){//// alert(i);// alert(val);// //逐个取出二维数组里的各个元素// })// }); //遍历json数组// var obj = { one:1, two:2, three:3};// $.each(obj, function(key, val) {// alert(key);// alert(val);// }); }); </script></head><body><!--//p段落隐藏--><p>点击我会消失</p><div id="haha"> <!--each用法--> <!--<input type="button" value="点击我会弹出li的内容"/>--> <!--<li>么</li>--> <!--<li>么</li>--> <!--<li>哒</li>--> <!--多选框和下拉列表--> <!--<input type="checkbox" id="mv"/><label for="mv">美女</label>--> <!--<input type="checkbox" id="m"/><label for="m">女</label>--> <!--<input type="checkbox" id="v"/><label for="v">美</label>--> <!--<button id="dw">点我告诉你选了几个</button>--> <!--<button id="d">点我告诉你选了什么</button>--> <!--<select id="gz">--> <!--<option>PHP</option>--> <!--<option>jquery</option>--> <!--<option>html</option>--> <!--<option>css</option>--> <!--</select>--> <!--<select id="xueli">--> <!--<option>大学</option>--> <!--<option>硕士</option>--> <!--<option>博士</option>--> <!--</select>--></div></body></html>
0 0
- jquery种种
- Jquery Ajax与.net webs ervice种种
- jquery预加载的四种种方式
- 刷新种种
- OpenThread种种
- 香水种种
- 其他种种
- 人际关系种种
- 指针 种种
- sizeof 种种
- wcf种种
- ibatis 种种
- css种种
- 种种可能
- react种种
- DLL之种种
- 灵机一动-趣味问题种种
- 关于枚举的种种
- smarty模板引擎_5-自定义变量调节器
- 测试jdbc注册驱动
- Android Get Internet Permssion
- 机房之功能模块
- Canny边缘检测
- jquery种种
- MYSQL执行计划Explain
- PAT1031查验身份证(15)
- Kafka源码分析(1)
- 图像质心分析:Matlab、质心法,高斯拟合法
- 为什么Nginx的性能要比Apache高很多?
- USACO-Section 3.2 Magic Squares(BFS)
- codeforces 652 A. Gabriel and Caterpillar
- Java总结篇系列:Java泛型