JQuery常用的api[最好是系统地学习一下《锋利的JQuery》]
text
Get the combined text contents of each element in the set of matched elements, including their descendants后裔, or set the text contents of the matched elements.
html
Get the HTML contents of the first element in the set of matched elements or set the HTML contents of every matched element.
val
Get the current value of the first element in the set of matched elements or set the value of every matched element.
each
.prop()
Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element.
.parent()
https://api.jquery.com/parent/
Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
.next()
Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
.eq()
Reduce the set of matched elements to the one at the specified index.
.on()
Attach an event handler function for one or more events to the selected elements.
http://live.datatables.net/depawowa/1/edit
jQuery.data()
https://api.jquery.com/jquery.data/
Store arbitrary data associated with the specified element and/or return the value that was set.
Contents:
.toggleClass()
http://api.jquery.com/toggleclass/
Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument.
使用场景http://live.datatables.net/kuwaduta/1/edit
jQuery.each
http://api.jquery.com/jquery.each/
$(this)
https://stackoverflow.com/questions/4735342/jquery-to-loop-through-elements-with-the-same-class
Use each: 'i' is the postion in the array, obj is the DOM object that you are iterating (can be accessed through the jQuery wrapper $(this) as well).
$('.testimonial').each(function(i, obj) {
//test
});
Check the api reference for more information.
JQuery常用的api[最好是系统地学习一下《锋利的JQuery》]的更多相关文章
- jQuery常用的API
1.jQuery给标签添加子元素(父子关系) jQuery对象.append("子"); 将div标签插入到ul标签之后 $("ul").append($('d ...
- jquery 常用api 小结2
*一)jQuery常用方法API实战 (1)DOM简述与分类 A)DOM是一种标准,它独立于平台,语言,浏览器. B)如果项目中,你完全按照DOM标准写代码,你就能在各大主流的浏览器中操作标准控件. ...
- JQuery常用API 核心 效果 JQueryHTML 遍历 Event事件
JQuery 常用API 参考资料:JQuery 官网 jQuery API 中文文档 核心 jQuery 对象 jQuery() 返回匹配的元素集合,无论是通过在DOM的基础上传递的参数还是创建 ...
- jquery中最常用的API有哪些
jquery中最常用的API有哪些 一.总结 一句话总结:取html的方法,class相关的方法,val相关的方法,data相关的方法,attr相关的方法 1.jQuery Object Access ...
- jQuery常用API之jQuery选择器
3.jQuery常用API 3.1 jQuery选择器 3.1.1 jQuery基础选择器 原生JS获取元素的方式很多.很杂,而且兼容性情况不一致,因此jQuery给我做了封装,是获取元素统一了标准 ...
- Jquery学习总结(1)——Jquery常用代码片段汇总
1. 禁止右键点击 ? 1 2 3 4 5 $(document).ready(function(){ $(document).bind("contextmenu",fun ...
- 锋利的jQuery学习总结
通过对<锋利的jQuery>(第二版)一书的学习,发现此书讲解通俗易懂,是学习jQuery的一本很好的指导书,特作如下总结.此书主要讲解了jQuery的常用操作,包括认识jQuery,jQ ...
- jQuery常用技巧-使用的总结
1.关于页面元素的引用 通过jquery的$()引用元素包括通过id.class.元素名以及元素的层级关系及dom或者xpath条件等方法,且返回的对象为jquery对象(集合对象),不能直接调用do ...
- 锋利的jQuery(第二版)学习总结
通过对<锋利的jQuery>(第二版)一书的学习,发现此书讲解通俗易懂,是学习jQuery的一本很好的指导书,特作如下总结. 此书主要讲解了jQuery的常用操作,包括认识jQuery,j ...
随机推荐
- 初学jQuery之jQuery虚假购物车-------与真实数据无关
初学者用jquery来写仿真的购物车,确实有点恶心,那我们今天就把这万恶的购物车剖析一下,来看看到底有什么难的. 购物车的效果图 那我们先从复选框开始吧,废话不多说,上代码!! 带有序号的,都是一些分 ...
- wcf 错误:无法加载或初始化请求的服务提供程序
解决办法:cmd netsh winsock reset 恢复网络编程接口
- for 循环练习题(2)
一张纸的厚度是0.0001米,将纸对折,对折多少次厚度超过珠峰高度8848米 var x=0.0001; for(var a=1;true;a++){ x=x*2; if (x>8848) { ...
- VHDL之User-defined data types
VHDL allows the user to define own data types. 1 user-defined integer types -- This is indeed the pr ...
- Arduino ULN2009驱动步进电机
一.实物图 二.例子代码 注:代码来自老外 http://www.4tronix.co.uk/arduino/Stepper-Motors.php 功能:控制电机正反转 // This Arduino ...
- java中为什么不允许类多重继承,却允许接口多重继承
首先看下面这一段代码:(底下有热心网友更正,jdk1.8之后情况确实有点变化,等改天有空继续更) interface a{ void b();}interface a1 extends a{ void ...
- 有关微信小程序
每个页面都要在app.json中配置 "pages": [ "pages/index/index", "pages/list/list", ...
- 【剑指Offer】21、栈的压入、弹出序列
题目描述: 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2 ...
- UVA489 - Hangman Judge【紫书例题4.2】
题意:就是给出一个字符串,让你去一个一个猜测,相同字母算一次,如果是之前猜过的也算错,如果你在错7次前猜对就算你赢,文章中是LRJ的例题代码. #include<stdio.h> #inc ...
- 关于 图论·并查集·HDU1232&1856
其核心是追溯其根数和链接两个数,而HDU 1856要多一步,每一个根数要标记自己和自己子数的个数,因此用结构体.注意:1856 用C写没超时,用C++写超时了╮(╯﹏╰)╭ 接下来是题目和代码: 畅通 ...