Home >Web Front-end >JS Tutorial >JQuery adds and removes DOM sample code in the page_jquery

JQuery adds and removes DOM sample code in the page_jquery

WBOY
WBOYOriginal
2016-05-16 17:31:251123browse

1.before(): Add the new node to the front

2.after(): Add the node to the lower part

3.prepend(): Turn the node into the first node

4.append(): Add a new node to the end, the effect is the same as appendTo(), but there is a difference in syntax

5.remove(): Remove the node

Example:

Copy code The code is as follows:

< ul>

  • Hawaiian Vac






  • Implementation:
    Copy code The code is as follows:


    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