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 ...
随机推荐
- position中的absolute、fixed区别
absolute: 绝对定位,相对于body. fixed: 固定定位,相对于浏览器视窗,不随滚动条的滚动而滚动. 这两个属性概念比较模糊,一般在做左边列表菜单,右边内容区域的时候会用到这样的定位 ...
- 【转】国外程序员整理的 PHP 资源大全
iadoz 在 Github 发起维护的一个 PHP 资源列表,内容包括:库.框架.模板.安全.代码分析.日志.第三方库.配置工具.Web 工具.书籍.电子书.经典博文等等. 依赖管理 依赖和包管 ...
- Java中last_insert_id的使用
last_insert_id的作用是:在当前表中的主键是自增时,插入一条新记录的同时使用last_insert_id可以获取当前的新记录的主键id. 下面是一个例子: import java.sql. ...
- border使用
border属性 border-width border-style border-color inherit border-style的值:none dotted(点线) dashed(虚 ...
- MacOS 升级后pod 出现的问题
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad ...
- 从柯洁对战AlphaGo,看商业智能
[摘要]李开复赛前说,AlphaGo和李世石的人机大战是第一次,可能还有悬念,那今天的AlphaGo已经在围棋的世界中彻底甩开了人类,不再拥有任何其他的可能.并指出,AlphaGo和柯洁的比赛并非没有 ...
- c# 读取 XML
XmlDocument xmldoc = new XmlDocument(); string xmlPath = HttpContext.Server.MapPath("~/*****.xm ...
- dispatch_sync
dispatch_sync does two things: queue a block blocks the current thread until the block has finished ...
- DATEPART()
定义和用法 DATEPART() 函数用于返回日期/时间的单独部分,比如年.月.日.小时.分钟等等. 语法 DATEPART(datepart,date) date 参数是合法的日期表达式.datep ...
- 定位IO瓶颈的方法,iowait低,IO就没有到瓶颈?
通过分析mpstat的iowait和iostat的util%,判断IO瓶颈 IO瓶颈往往是我们可能会忽略的地方(我们常会看top.free.netstat等等,但经常会忽略IO的负载情况),今天给大家 ...