<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>index</title>
<script type="text/javascript" src="jquery-3.1.1.min.js"> </script>
<script type="text/javascript">
$(function(){
console.log("选择器“p[align]”长度为:"+$("p[align]").length);
console.log("选择器“p[align='center']”长度为:"+$("p[align='center']").length);
console.log("选择器“p[title='hellohtmlworld']t”长度为:"+$("p[title='hellohtmlworld']").length);
console.log("选择器“p[title^='hello ']”长度为:"+$("p[title^='hello ']").length);
console.log("选择器“p[title$='world']”长度为:"+$("p[title$='world']").length);
console.log("选择器“p[title*='html']”长度为:"+$("p[title*='html']").length);
console.log("选择器“p[title~='hello']”长度为:"+$("p[title~='hello']").length);
console.log("选择器“p[title|='hello']”长度为:"+$("p[title|='hello']").length);
console.log("选择器[href^='http'][title='hello-html-world']”长度为:"+$("[href^='http'][title='hello-html-world']").length);
}
);
</script>
</head>
<body>
<div>
<p align="center">hello world!</p>
<p align="">hello world!</p>
</div>
<div class="test" id="test" align="" style="background-color:#CCCCCC">
<p class="test" title="hello">hello world!</p>
<p class="test" title="hello html world">hello world!</p>
<p class="test1" title="hellohtmlworld">hello world!</p>
<p class="test1" title="hello-html-world">hello world!</p>
<a class="test1" title="hello-html-world" href="http://www.cnblogs.com/yw0219/p/5928955.html">JQuery选择器</a>
</div>
</body>
</html>

结果:

演示-JQuery属性选择器的更多相关文章

  1. jquery 属性选择器

    jquery 属性选择器   第一种根据属性选择E[attr] $("[title]").click().......... 即选择所有元素内 属性带有title的元素即<l ...

  2. jquery-6 jquery属性选择器

    jquery-6 jquery属性选择器 一.总结 一句话总结:jquery操作就是选择器加jquery对象的各种方法. 1.大量操作样式用什么方式? 大批量样式通过加类和减类完成 2.jquery中 ...

  3. jquery属性选择器(同时匹配多个条件)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. jquery属性选择器

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. jquery属性选择器(匹配具有指定属性的元素)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. jQuery属性选择器.attr()和.prop()两种方法

    在判断表单单选框是否被选中时,通常会想到使用$('#checkbox').attr('checked')来判断,但在一些情况下,你会发现这种方法并不管用,得到的是undefined. 原来jQuery ...

  7. Jquery 属性选择器&设置元素属性

    什么是属性选择器呢?感觉理解起来有点难,举个例子就很容易明白了,<div id="ajaxa"></div>这里的id就是属性,这下就很容易理解了, jqu ...

  8. jquery属性选择器中|value和^value的区别

    jquery的属性选择中有两个比较混淆:一个是[attribute^value], 另一个是[attribute|value]. 先看解释: [attribute^value]:选取属性的值以valu ...

  9. Jquery属性选择器(同时匹配多个条件,与或非)(附样例)

    1. 前言 为了处理除了两项不符合条件外的选择,需要用到jquery选择器的多个条件匹配来处理,然后整理了一下相关的与或非的条件及其组合. 作为笔记记录. 2. 代码 <!DOCTYPE htm ...

随机推荐

  1. cocos2d-x开发记录:一,搭建环境

    首先我下载的cocos2D版本为2.1.2版本,我们安装好VS后,新建一个解决方案,这里很重要,假设我的cocos解压后的路径为E:\cocos2d-2.1rc0-x-2.1.2-hotfix\coc ...

  2. Java 并发多线程处理优秀博文整理

    多线程(11)-Fork/Join-Java并行计算框架 推荐理由:Java在JDK7之后加入了并行计算的框架Fork/Join,本文是对其讲解 分解和合并:Java 也擅长轻松的并行编程! 推荐理由 ...

  3. [k8s]k8s 1.9(on the fly搭建) 1.9_cni-flannel部署排错 ipvs模式

    角色 节点名 节点ip master n1 192.168.14.11 节点1 n2 192.168.14.12 节点2 n3 192.168.14.13 https://raw.githubuser ...

  4. 【Android】7.5 RelativeLayout(相对布局)

    分类:C#.Android.VS2015: 创建日期:2016-02-11 一.简介 RelativeLayout是一种相对布局,容器中子元素的位置是相对于其前一个元素或者其他元素的位置来计算的,或者 ...

  5. 基于乐观锁的配置server与XServer的交互

    XServer与配置server,配置server保存有XServer的配置文件里的信息. 怎样在项目启动时.让XServer从配置server中获取到自己的配置信息,并达到通信资源的节省与控制. 通 ...

  6. angular学习笔记(十五)-module里的'服务'

    本篇介绍angular中的模块:module 在笔记(二)http://www.cnblogs.com/liulangmao/p/3711047.html里已经讲到过模块,这篇主要讲模块的 '服务' ...

  7. 浅谈C#委托和事件【转】

    委托给了C#操作函数的灵活性,我们可使用委托像操作变量一样来操作函数,其实这个功能并不是C#的首创,早在C++时代就有函数指针这一说法,而在我看来委托就是C#的函数指针,首先先简要的介绍一下委托的基本 ...

  8. [WF4.0 实战] AutoResetEvent具体解释(线程独占訪问资源)

    由来: 在学习工作流的过程中,宿主程序中会出现这么一段代码: staticAutoResetEvent instanceUnloaded = new AutoResetEvent(false); 然后 ...

  9. 【Unity笔记】经典的鼠标点击射线检测碰撞

    void Update (){ )){ //从摄像机发出到点击坐标的射线 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Ra ...

  10. 【SpringMVC笔记】第三课 处理器映射器+处理器适配器

    第二课的例子中,在springmvc.xml中配置使用了第一种处理器映射器和处理器适配器,如下所示. <!-- 配置第一种处理器映射器 BeanNameUrlHandlerMapping --& ...