Home >Web Front-end >JS Tutorial >Detailed explanation of jquery remove method application_jquery

Detailed explanation of jquery remove method application_jquery

WBOY
WBOYOriginal
2016-05-16 17:48:121092browse
Copy code The code is as follows:

$(document).ready(function () {
var dom = $("span"); //From http://www.cnblogs.com/ahjesus Respect the author's hard work, please indicate the source when reprinting, thank you!
$(dom[0]).remove( );
console.log(dom.length) //5
console.log($(dom).length) //5
console.log($("span").length) / /4
console.log($(dom[0]).text()) //A
})

If you use variables to store jquery objects, after deletion, The deleted object still exists in the cache. When further operations are performed, the cached object is cleared.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn