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
Release: 2016-05-16 17:31:25
Original
1108 people have browsed it

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:


    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