jQuery API jQuery API 中英文对照版
end()
end()

结束最近的“破坏性”操作,把匹配的元素列表回复到前一个状态。在调用end函数后,匹配的元素列表会回复到上一个操作之前的匹配元素列表状态。

如果前面的操作(对元素列表的状态)没有破坏性,则什么也不改变。

返回值:jQuery

示例:

选择所有段落,并在它们中查找span元素,然后恢回复到选择所有段落的状态。

$("p").find("span").end();

HTML 代码:

<p><span>Hello</span>, how are   you?</p>

结果:

[ <p>...</p> ] 
 
end()

Revert the most recent 'destructive' operation, changing the set of matched elements to its previous state (right before the destructive operation).

If there was no destructive operation before, an empty set is returned.

A 'destructive' operation is any operation that changes the set of matched jQuery elements. These functions are: add, children, clone, filter, find, not, next, parent, parents, prev and siblings.

Return value: jQuery
Example:

Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs.

 $("p").find("span").end();  

Before:

 <p><span>Hello</span>, how are you?</p>  
Result:
 [ <p>...</p> ]  
相关链接
WEB开发网 | PHP教程 | Mysql教程 | Apache教程 | 最新文章 | PHP面试题| 网站地图 | Google地图 | Baidu地图 | 在线WEB论坛

WEB技术QQ交流群:245735*** 站长Q号:245735***
版权所有者:WEB开发网 地址:云南省文山州砚山县盘龙乡 滇ICP备12002707号-10
特别声明:本站内容仅供参考,不作为设计及确切依据!想了解更多,可立即进入Bbs提问