博客
关于我
jQuery属性选择器(附有代码以及运行截图)
阅读量:164 次
发布时间:2019-02-28

本文共 1061 字,大约阅读时间需要 3 分钟。

jQuery ?????? JavaScript ?????? XPath ?????? XML ???????????XPath ?????????????????? DOM ????????

XPath ?????

? jQuery ??XPath ????????????????????????????

1. ?????

????????????????

$("[attribute='value']")

????? id ???? "testDiv" ????

$("[id='testDiv']")

2. ????????

??????????????????

$("[attribute*='value']")

????? title ?????? "Home" ????

$("[title*='Home']")

3. Exactly???

?????????????????

$("[attribute='value']")

????? id ??????? "testDiv" ????

$("[id='testDiv']")

4. ??????

???????????????

$("[attribute!='value']")

????? id ????? "testDiv" ????

$("[id!='testDiv']")

5. ???????????

??????????????????

$("[attribute^='value']")

????? id ???? "test" ??????

$("[id^='test']")

6. ?????????

???????????????????????

$("[attribute1='value1'][attribute2='value2']")

????? id="testDiv" ? class="card" ????

$("[id='testDiv'][class='card']")

??

???? HTML ???

Title
testText
testText2
testText3

???? jQuery ???

$testDiv = $('div[id*="testDiv"]');

?????? id ???? "testDiv" ????

????

????????????????????????????? web ????????

转载地址:http://sqzj.baihongyu.com/

你可能感兴趣的文章
Mac OS 12.0.1 如何安装柯美287打印机驱动,刷卡打印
查看>>
MangoDB4.0版本的安装与配置
查看>>
Manjaro 24.1 “Xahea” 发布!具有 KDE Plasma 6.1.5、GNOME 46 和最新的内核增强功能
查看>>
mapping文件目录生成修改
查看>>
MapReduce程序依赖的jar包
查看>>
mariadb multi-source replication(mariadb多主复制)
查看>>
MaterialForm对tab页进行隐藏
查看>>
Member var and Static var.
查看>>
memcached高速缓存学习笔记001---memcached介绍和安装以及基本使用
查看>>
memcached高速缓存学习笔记003---利用JAVA程序操作memcached crud操作
查看>>
Memcached:Node.js 高性能缓存解决方案
查看>>
memcache、redis原理对比
查看>>
memset初始化高维数组为-1/0
查看>>
Metasploit CGI网关接口渗透测试实战
查看>>
Metasploit Web服务器渗透测试实战
查看>>
Moment.js常见用法总结
查看>>
MongoDB出现Error parsing command line: unrecognised option ‘--fork‘ 的解决方法
查看>>
MongoDB学习笔记(8)--索引及优化索引
查看>>
ms sql server 2008 sp2更新异常
查看>>
MS UC 2013-0-Prepare Tool
查看>>