jQuery API .not()
来源:互联网 发布:在淘宝上买电脑靠谱吗 编辑:程序博客网 时间:2024/05/22 04:26
.not()
描述: 从匹配的元素集合中移除指定的元素。
.not( selector )
- selector类型: Selector一个用于匹配元素的选择器字符串。
.not( elements )
- elements类型: Elements要从匹配元素集合中移除的一个或多个DOM元素。
.not( function(index) )
- function(index)类型: Function()一个函数用作测试集合中的每个元素。
this
是当前DOM元素。
.not( jQuery object )
- jQuery object类型: PlainObject现有匹配当前元素集合的jQuery对象。
.not()
方法构建一个新的匹配元素的jQuery对象,用于存放筛选后的元素。所提供的选择器是对每个元素进行测试;如果元素不匹配的选择将包括在结果中例子:
Example: 为不是绿色或蓝色的 div 添加边框。
<!doctype html><html><head><meta charset="utf-8"><title>无标题文档</title><script src="jquery-1.10.2.js"></script><style>div { width:50px; height:50px; margin:10px; float:left; background:yellow; border:2px solid white; }.green { background:#8f8; }.gray { background:#ccc; }#blueone { background:#99f; }</style></head><body> <div></div><div id="blueone"></div><div></div><div class="green"></div> <div class="green"></div><div class="gray"></div><div></div> <script> $("div").not(".green,#blueone").css("border-color","red"); </script> </body></html>效果图:
Example: 从段落集合中移除 ID 是 "selected" 的元素。
1
$("p").not( $("#selected")[0] )
Example: 从段落集合中移除 ID 是 "selected" 的元素。
1
$("p").not("#selected")
Example: 从段落集合中移除满足 "div p.selected" 的元素。
1
$("p").not($("div p.selected"))
0 0
- jQuery API .not()
- Jquery :not
- jQuery API
- jquery api
- jquery api
- jQuery API
- jQuery:jQuery UI API
- jQuery 遍历 - not() 方法
- jQuery is not defined
- jQuery eq() filter() not()
- Jquery 遍历---not()
- $ jQuery is not defined
- jQuery is not defined
- jQuery :not()选择器
- cant not find jquery
- jQuery API 精美图
- google api 调用 jquery
- jQuery.validate.js API
- Objective C URL编码转换
- ORA-06531:Reference to uninitialized collection 问题解决
- java热部署
- java导出csv用excel打开后数字不用科学计数法显示
- 关于Linux的视频编程(v4l2编程)
- jQuery API .not()
- Linux DMA详解
- hdu_1019 Least Common Multiple(最小公倍数)
- UIWebView的几个小技巧
- ssh-keygen的使用方法
- 浅谈HTTP中Get与Post的区别
- response.setContentType()的参数 你知道多少
- ViewPager的循环滑动
- WebRTC VoiceEngine使用简单Demo