Home > Web Front-end > JS Tutorial > body text

Detailed explanation of jquery remove method application_jquery

WBOY
Release: 2016-05-16 17:48:12
Original
1087 people have browsed it
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.
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template