主题:
3024-night
ambiance-mobile
ambiance
base16-dark
blackboard
cobalt
eclipse
erlang-dark
lesser-dark
mbo
mdn-like
midnight
monokai
neat
neo
night
paraiso-dark
pastel-on-dark
rubyblue
solarized
the-matrix
tomorrow-night-eighties
vibrant-ink
新窗口
视图:
左侧面板
HTML
CSS
JS
预览
F11(全屏显示选中的编辑器)
查看更多帮助信息
相关文章:
jQuery 选择器(ancestor descendant)详解
代码类型:
默认(HTML/CSS/JS)
HTML混合(单页)
PHP
Java
C#
C++
C
SQL
杂项:
启用CSS/JS语法检查
监测脚本运行错误
禁止库文件重复
文档类型:
HTML5
HTML 4.01 Strict
HTML 4.01 Transitional
HTML 4.01 Frameset
XHTML 1.0 Strict
XHTML 1.0 Transitional
XHTML 1.0 Frameset
无
JS库文件:
无
jQuery 1.11.1
jQuery 2.1.1
jQuery 1.10.2
jQuery 1.9.1
jQuery 1.8.3
jQuery 1.7.2
jQuery 1.6.4
jQuery 1.5.2
jQuery 1.4.4
jQuery 1.3.2
jQuery 1.2.6
手动添加:
jQuery 1.11.1
<div id="n1"> <p id="n2" class="test"> <span id="n3" class="a">Hello</span> </p> <p id="n4" class="detail"> <span id="n5" class="b codeplayer">World <span id="n6" class="c">365mini.com</span> </span> </p> </div>
// 扩展jQuery对象,添加showTagInfo()方法 // 用于将jQuery对象所有匹配元素的标识信息追加到body元素内 // 每个元素的标识信息形如:"tagName"或"tagName#id" jQuery.fn.showTagInfo = function(){ var tags = this.map( function(){ return this.tagName + ( this.id ? "#" + this.id : "" ); } ).get(); $("body").append( tags.join("<br>") + "<br><br>" ); }; // 选择了id分别为n2、n4的2个元素 $("#n1 p").showTagInfo(); // 匹配p元素的所有后代span元素 // 选择了id分别为n3、n5、n6的3个元素 $("p span").showTagInfo(); // 匹配id为n1的元素的后代中 // 选择了id为n6的一个元素 $("#n1 p.detail span.c").showTagInfo();