Home > Web Front-end > JS Tutorial > Introduction to the usage of append() and appendTo() for node insertion_jquery

Introduction to the usage of append() and appendTo() for node insertion_jquery

WBOY
Release: 2016-05-16 17:04:00
Original
1312 people have browsed it
Copy code The code is as follows:





jquery






  • Good

  • Very good
  • Very good

  • Exceptionally good

  • It's so good

  • It's so good that it can't be described





Operation on existing nodes
Copy code The code is as follows:





jquery4

< script type="text/javascript">
$(function(){
var li1 = $("
  • hello
  • ");
    var li2 = $("
  • world
  • ");
    var li3 = $("
  • hello world
  • ") ;
    $("ul").append(li1);
    $("ul").prepend(li2);
    $("ul li:eq(4)").after(li3 );

    });



    What do you think Is the training at San Si Park good?



    • Good

    • Very good
    • Very good

    • Exceptionally good

    • It's so good

    • It's so good that it can't be described



    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