$( "html" ).parent()方法返回一个包含document的集合,而$( "html" ).parents()返回一个空集合 哪位大神来解释下?
check
check 2016-12-20 09:17:03
0
2
1217
check
check

reply all(2)
数据分析师

$( "html" ).parent() method returns a collection containing documents, while $( "html" ).parents() returns an empty collection. Can any expert explain it? -PHP Chinese website Q&A-The $( "html" ).parent() method returns a collection containing documents, while $( "html" ).parents() returns an empty collection. Can any expert explain it? -PHP Chinese website Q&A

Please watch and learn.

迷茫

parents()是取得一个包含着所有匹配元素的祖先元素的元素集合(不包含根元素),而parent()是取得一个包含着所有匹配元素的唯一父元素的元素集合。当$的对象是根元素html时,parents()就是空集合,parent()就是文档集合

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template