JQuery Basic Features Quick Walkthrough
1. Basic Selectors
$('p')—Accesses all the paragraph elements in the HTML file
$('div')—Accesses all the div elements in the HTML file
$('#A')—Accesses all the HTML elements with id=A
$('.b')—Accesses all the HTML elements with class=b
2. Applying CSS to Elements
$('div').addClass('highlight');
3. Some basic selection APIs
// select all the elements that contain the text Life
$('span:contains(Life)').addClass('highlight'); $('div:odd').addClass('highlight');
$('div:even').addClass('boundary');
$('p:eq(1)').addClass('linkstyle');
4. Obtaining the HTML of an Element
alert($('p').html());
5. Changing the Content of a DOM Node
$('#textId').text('some text content');
$('p').html('<b>We can create Rich Internet Applications </b><br/>by making AJAX requests');
6. Creating a DOM Node on the Fly
1) Inserts the specified content at the beginning of the selected element and returns a jQuery object
$('p').prepend('<h2> Power of selectors </h2>');
JQuery Basic Features Quick Walkthrough的更多相关文章
- How to Create a Basic Plugin 如何写一个基础的jQuery插件
How to Create a Basic Plugin Sometimes you want to make a piece of functionality available throughou ...
- [Windows Azure] Walkthrough to Configure System Center Management Pack for Windows Azure Fabric Preview for SCOM 2012 SP1 (with a MetricsHub Bonus)
The wait is finally over. This is a huge update to the Azure Management Pack over the one that was r ...
- How to Create a Basic Plugin
Sometimes you want to make a piece of functionality available throughout your code. For example, per ...
- jQuery入门[1]-构造函数【转载】
最近看了一些jquery的进阶教程,感觉很不错,与大家分享下! jQuery——构造函数 ◦体积小(v1.2.3 15kb)◦丰富的DOM选择器(CSS1-3 + XPath) ◦跨浏览器(IE6,F ...
- 21个很棒的jQuery分页插件下载
分页是指将一个大内容划分为各种不同的页面,因此网站的分页是一个很重要的部分,必须让内容有组织性和易于访问.分页有各两种不同的方式,手动跟自动.最受欢迎简单和广泛的方法是jQuery插件.下面我们收集了 ...
- JavaScript大杂烩15 - 使用JQuery(下)
前面我们总结了使用各种selector拿到了jQuery对象了,下面就是对这个对象执行指定的行为了. 2. 操作对象 - 行为函数action 执行jQuery内置的行为函数的时候,JQuery自动遍 ...
- JavaScript大杂烩14 - 使用JQuery(上)
JQuery意义 - Why? 为什么要使用JQuery,从我个人来说,就是这么几点:简化代码 + 统一行为 + 功能强大 + 搭配方便. 简化代码是从写代码的角度来说的,实现同样的功能,如果用Jav ...
- 一些必看的jQuery导航插件和教程
导航是一个网站最重要的元素之一,您必须遵循统一的风格来设计您的网站,特别是导航的风格,让用户可以轻松地找到他们想要的内容.这里最大的部分是开发一个菜单,即要直观易用,又要符合你网站的设计风格.本文列举 ...
- JQuery系列(2) - 事件处理
JQuery事件绑定 (1)on方法 on方法是jQuery事件绑定的统一接口.后面介绍的事件绑定的那些简便方法,其实都是on方法的简写形式. $('li').on('click', function ...
随机推荐
- GitHub开源库排名一百的简单介绍,值得收藏!
GitHub Android Libraries Top 100 简介 本项目主要对目前 GitHub 上排名前 100 的 Android 开源库进行简单的介绍, 至于排名完全是根据 GitHub ...
- LeetCode题解——Roman to Integer
题目: 将罗马数字转换为整数. 解法: 可以参考上一篇数字转换为罗马数字的规则. 代码: class Solution { public: int sym2int(char sym) //罗马数字字符 ...
- 【和我一起学python吧】python入门语法总结
1.python是一个解释性语言: 一个用编译性语言比如C或C++写的程序可以从源文件(即C或C++语言)转换到一个你的计算机使用的语言(二进制代码,即0和1).这个过程通过编译器和不同的标记.选项完 ...
- 纯CSS制作冒泡提示框
来源:http://www.ido321.com/1214.html 前两天翻译了一篇文章,关于利用css的border属性制作基本图形:http://www.ido321.com/1200.html ...
- htmlcss笔记--标签默认值样式重置css reset(2)
1.内联,内嵌,行内元素: 默认可以继续跟同类型标签显示: 由内容撑开宽度,内容多宽,会有多宽: span,内嵌标签部支持宽高,即使加了宽高也不支持, 也不支持上下内外边距,但是支持左右内外边距:内上 ...
- Tkinter教程之Radiobutton篇
本文转载自:http://blog.csdn.net/jcodeer/article/details/1811308 #Tkinter教程之Radiobutton篇#Radiobutton为单选按钮, ...
- 《Genesis-3D开源游戏引擎完整实例教程-2D射击游戏篇04:碰撞检测》
4.碰撞检测 碰撞概述: 游戏世界里,游戏对象不能做出如同在真实世界里的物理运动效果.对于大部分游戏来说,都要为其添加物理系统,让其可以模拟真实世界发生的物理运动.但是在这个打飞机游戏Demo中,是用 ...
- Google AppEngine 创建的例子
1.guestbook: http://chenyy-gac-test.appspot.com/ 2.time clock: http://chenyy-gac-20150922.appspot.co ...
- workstack windows to openstack
https://www.mirantis.com/openstack-portal/express-openstack-portal/migrating-from-vmware-for-windows ...
- dedecms
http://www.duodede.com/free/ [free templte] http://www.xiuzhanwang.net/d